2012-05-08 40 views
0

我剛剛從TFS中檢出了一個asp net mvc項目。安裝完所有必需的NuGet包後,我試圖運行該項目。找不到類型'System.Web.Mvc.WebFormView'的構造函數

  • SiteMapTitle()
  • 網站地圖()
  • 的SiteMapPath()

嘗試使用MvcSiteMapProvider下列方法之一時,我不斷收到此錯誤信息我正在使用.NET Framework 4.0,MVC3和MvcSiteMapProvider版本3.2.2.0。

我通過NuGet(包管理器控制檯)安裝了MvcSiteMapProvider。

我的項目中引用的DLL中... \包\ MvcSiteMapProvider.3.2.2.0 \ LIB \ net40 \ MvcSiteMapProvider.dll,使用運行時版本V2.0.50727

[MissingMethodException: Constructor on type 'System.Web.Mvc.WebFormView' not found.] 
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1136 
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +111 
System.Activator.CreateInstance(Type type, Object[] args) +19 
MvcSiteMapProvider.Internal.MvcSiteMapProviderViewEngine.CreatePartialView(ControllerContext controllerContext, String partialPath) +109 
System.Web.Mvc.VirtualPathProviderViewEngine.FindPartialView(ControllerContext controllerContext, String partialViewName, Boolean useCache) +217 
System.Web.Mvc.<>c__DisplayClass8.<FindPartialView>b__7(IViewEngine e) +21 
System.Web.Mvc.ViewEngineCollection.Find(Func`2 lookup, Boolean trackSearchedPaths) +127 
System.Web.Mvc.ViewEngineCollection.FindPartialView(ControllerContext controllerContext, String partialViewName) +170 
System.Web.Mvc.Html.TemplateHelpers.ExecuteTemplate(HtmlHelper html, ViewDataDictionary viewData, String templateName, DataBoundControlMode mode, GetViewNamesDelegate getViewNames, GetDefaultActionsDelegate getDefaultActions) +418 
System.Web.Mvc.Html.TemplateHelpers.TemplateHelper(HtmlHelper html, ModelMetadata metadata, String htmlFieldName, String templateName, DataBoundControlMode mode, Object additionalViewData, ExecuteTemplateDelegate executeTemplate) +1117 
System.Web.Mvc.Html.TemplateHelpers.TemplateHelper(HtmlHelper html, ModelMetadata metadata, String htmlFieldName, String templateName, DataBoundControlMode mode, Object additionalViewData) +66 
System.Web.Mvc.Html.TemplateHelpers.TemplateFor(HtmlHelper`1 html, Expression`1 expression, String templateName, String htmlFieldName, DataBoundControlMode mode, Object additionalViewData, TemplateHelperDelegate templateHelper) +117 
System.Web.Mvc.Html.TemplateHelpers.TemplateFor(HtmlHelper`1 html, Expression`1 expression, String templateName, String htmlFieldName, DataBoundControlMode mode, Object additionalViewData) +100 
System.Web.Mvc.Html.DisplayExtensions.DisplayFor(HtmlHelper`1 html, Expression`1 expression, String templateName) +57 
MvcSiteMapProvider.Web.Html.SiteMapTitleHelper.SiteMapTitle(MvcSiteMapHtmlHelper helper, String templateName) +412 
MvcSiteMapProvider.Web.Html.SiteMapTitleHelper.SiteMapTitle(MvcSiteMapHtmlHelper helper) +33 
ASP._Page_Views_Shared__Layout_cshtml.Execute() in xxx\Views\Shared\_Layout.cshtml:28 

任何幫助,將不勝感激。

+0

您使用的是什麼.NET版本? – Xharze

+0

抱歉,忘了把它添加到問題 – ckonig

+0

你是如何獲得MvcSiteMapProvider的?的NuGet?手動構建? – Xharze

回答

0

嘗試更新到版本3.2.3,那麼它應該工作。

相關問題