我正在尝试为MVC4做一个自定义构建,这是出于教育目的而不是项目。
我从http://aspnetwebstack.codeplex.com/
获取代码编译好,做一个小改动,得到输出System.Web.Mvc并将其注入我的项目中。
我从项目中删除了System.Web.Mvc的引用,并链接到自定义的引用。 我总是得到这个错误
Could not load file or assembly 'System.Web.Mvc' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
我使用sn工具忽略dll验证并确保它已添加到注册表
我更改了web.config
`<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>`
像这样做
`<assemblyIdentity name="System.Web.Mvc" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>`
我甚至试图从web.config中删除上面的代码 没有这些解决了。
我想要实现的是看到我在自定义构建System.Web.Mvc中创建的新行为
我正在使用Windows 7 X64和vs.net 2012