1

我最近重新安装了我的电脑。安装 VS2010 和 VS 2012 等所有工具后,我在构建 MVC 解决方案时开始收到以下错误:

The type 'System.Web.Mvc.TagBuilder' exists in both 
'c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.dll' 
and 
'c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET WebPages\v2.0\Assemblies\System.Web.WebPages.dll'

我正在使用 Windows 8,Web 应用程序以 .net 4 为目标。

我怎样才能消除这个冲突?

4

1 回答 1

1

<runtime>您的 web.config 部分中添加:

  <dependentAssembly>
    <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
  </dependentAssembly>
于 2013-01-22T11:39:58.003 回答