MVC3升级到Mvc4
1.项目引用修改(如果不是需要修改)
System.Web,System.Web.Mvc, 从3.0改为4.0的dll引用
System.Web.Helpers,System.Web.WebPages 从1.0改为2.0的dll引用
2.项目web.config文件修改
<add key="webpages:Version" value="1.0.0.0" /> 1.0改为2.0
在上一行下面添加<add key="PreserveLoginUrl" value="true"/>
System.Web.Abstractions,System.Web.Routing,System.Web.Mvc 从3.0改为4.0
System.Web.Helpers,System.Web.WebPages 从1.0改为2.0
如果本项目引用的其它dll应用了Mvc3相关资源,则添加
<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/> <bindingRedirectold Version="1.0.0.0" newVersion="2.0.0.0"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="4.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/> <bindingRedirectold Version="1.0.0.0" newVersion="2.0.0.0"/> </dependentAssembly> </assemblyBinding> </runtime>
3.View/web.config文件修改
将相关3.0改为4.0,相关1.0改为2.0
4.打开项目文件,将{E53F8FEA-EAE0-44A6-8774-FFD645390401}替换 为 {E3E379DF-F4C6-4180-9B81-6769533ABE47}
http://www.cnblogs.com/fumj/p/3588517.html
http://blog.csdn.net/a497785609/article/details/8274501