问题描述
下载 ASP.NET MVC 5.x 模板后,我更新连接字符串,恢复 NuGet 包,然后尝试在包管理器控制台中运行 Update-Database
命令,但我始终得到以下信息错误:
After downloading ASP.NET MVC 5.x template, I update the connection string, restore NuGet packages and then try to run Update-Database
command in Package Manager Console, but I consistently get the following error:
无法加载文件或程序集Castle.Core,版本=4.0.0.0,文化=中性,PublicKeyToken=407dd0808d44fbdc"或其依赖项之一.定位的程序集的清单定义与程序集引用不匹配.(来自 HRESULT 的异常:0x80131040)
我能够通过删除所有软件包并一次添加一个来解决此问题,但这非常耗时.
I was able to solve this once by removing all packages and adding them back one at a time, but this is extremely time-consuming.
我对 Angular 和 Multipage 版本都有同样的体验,我正在使用 VS2017 社区.
I have had this same experience with both the Angular and Multipage versions, and I am using VS2017 Community.
我做错了什么?
推荐答案
<dependentAssembly>
<assemblyIdentity name="Castle.Core" publicKeyToken="407dd0808d44fbdc" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
您可以删除绑定重定向.
You can remove that binding redirect.
这篇关于ASP.NET Boilerplate MVC 5.x 模板无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!