CS0012: The type 'System.Web.Routing.RouteValueDictionary' is defined in an assembly that is not referenced

人走茶凉 提交于 2019-12-01 07:14:04

问题


I got this error using a new "ASP.NET MVC 2 Empty Web Application" project:

CS0012: The type 'System.Web.Routing.RouteValueDictionary' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.


回答1:


Update web.config file:

<?xml version="1.0"?>
<configuration>
    <system.web>
        <compilation debug="true" targetFramework="4.0">
            <assemblies>
                <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
            </assemblies>
        </compilation>
        ...
    </system.web>
    ...
</configuration>


来源:https://stackoverflow.com/questions/2828393/cs0012-the-type-system-web-routing-routevaluedictionary-is-defined-in-an-asse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!