Asp.net mvc 3 类型为'的构造函数;System.Web.Mvc.WebFormView';找不到

Asp.net mvc 3 类型为'的构造函数;System.Web.Mvc.WebFormView';找不到,asp.net-mvc-3,mvcsitemapprovider,Asp.net Mvc 3,Mvcsitemapprovider,我刚刚从TFS签出了一个asp net mvc项目。在安装了所有必需的NuGet软件包之后,我尝试运行该项目 尝试使用MvcSiteMapProvider的以下方法之一时,我不断收到此错误消息: SiteMapTitle() 网站地图() SiteMapPath() 我使用的是.NETFramework 4.0、MVC3和MvcSiteMapProvider版本3.2.2.0 我通过NuGet(PackageManager控制台)安装了MvcSiteMapProvider 我的项目使用运行时

我刚刚从TFS签出了一个asp net mvc项目。在安装了所有必需的NuGet软件包之后,我尝试运行该项目

尝试使用MvcSiteMapProvider的以下方法之一时,我不断收到此错误消息:

  • SiteMapTitle()
  • 网站地图()
  • SiteMapPath()
我使用的是.NETFramework 4.0、MVC3和MvcSiteMapProvider版本3.2.2.0

我通过NuGet(PackageManager控制台)安装了MvcSiteMapProvider

我的项目使用运行时版本v2.0.50727引用…\packages\mvcsitemprovider.3.2.0\lib\net40\mvcsitemprovider.DLL中的DLL

[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
[MissingMethodException:找不到类型为'System.Web.Mvc.WebFormView'的构造函数。]
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr、Binder Binder、Object[]args、CultureInfo区域性、Object[]activationAttributes)+1136
System.Activator.CreateInstance(类型类型、BindingFlags bindingAttr、Binder Binder、对象[]参数、CultureInfo区域性、对象[]activationAttributes)+111
System.Activator.CreateInstance(类型,对象[]args)+19
MvcSiteMapProvider.Internal.MVCSItemApproviderServiceEngine.CreatePartialView(ControllerContext ControllerContext,String partialPath)+109
System.Web.Mvc.VirtualPathProviderViewEngine.FindPartialView(ControllerContext ControllerContext,String partialViewName,Boolean useCache)+217
System.Web.Mvc.c__显示类8.b___7(IViewEngine)+21
System.Web.Mvc.ViewEngineCollection.Find(Func`2查找,布尔跟踪搜索路径)+127
System.Web.Mvc.ViewEngineCollection.FindPartialView(ControllerContext ControllerContext,String partialViewName)+170
System.Web.Mvc.Html.TemplateHelpers.ExecuteTemplate(HtmlHelper Html、ViewDataDictionary viewData、字符串templateName、DataBoundControlMode、getViewNames委托getViewNames、getDefaultActions委托getDefaultActions)+418
TemplateHelper(HtmlHelper Html、ModelMetadata元数据、字符串htmlFieldName、字符串templateName、DataBoundControlMode模式、对象附加视图数据、ExecuteTemplateDelegate executeTemplate)+1117
System.Web.Mvc.Html.TemplateHelpers.TemplateHelper(HtmlHelper Html、ModelMetadata元数据、字符串htmlFieldName、字符串templateName、DataBoundControlMode模式、对象additionalViewData)+66
System.Web.Mvc.Html.TemplateHelpers.TemplateFor(HtmlHelper`1 Html,表达式`1表达式,字符串templateName,字符串htmlFieldName,DataBoundControlMode模式,对象附加视图数据,TemplateHelperDelegate templateHelper)+117
System.Web.Mvc.Html.TemplateHelpers.TemplateFor(HtmlHelper`1 Html,表达式`1表达式,字符串templateName,字符串htmlFieldName,DataBoundControlMode模式,对象附加视图数据)+100
System.Web.Mvc.Html.DisplayExtensions.DisplayFor(HtmlHelper`1HTML,表达式`1表达式,字符串模板名)+57
MvcSiteMapProvider.Web.Html.SiteMapTitleHelper.SiteMapTitle(MvcSiteMapHtmlHelper帮助程序,字符串templateName)+412
MvcSiteMapProvider.Web.Html.SiteMapTitleHelper.SiteMapTitle(MvcSiteMapHtmlHelper)+33
ASP.\u页面\视图\共享\布局\ cshtml.Execute()在xxx\Views\Shared\\布局中。cshtml:28

如果有任何帮助,我们将不胜感激。

尝试更新到3.2.3版,然后它就可以工作了

您使用的是什么.NET版本?抱歉,忘记将其添加到问题中。您是如何获得MvcSiteMapProvider的?努吉?手动生成?可以检查您的引用并查看您是否引用了net35或net40文件夹中的DLL?这很奇怪,它应该只在旧的MVC版本上使用
Activator.CreateInstance
。你能试试新版本的3.2.3.0吗?