ASP.NET Boilerplate MVC 5.x template fails to start

≯℡__Kan透↙ 提交于 2020-01-03 04:24:30

问题


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:

Could not load file or assembly 'Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from 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.

I have had this same experience with both the Angular and Multipage versions, and I am using VS2017 Community.

What am I doing wrong?


回答1:


in the Web project's web.config it reads:

<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.



来源:https://stackoverflow.com/questions/48179819/asp-net-boilerplate-mvc-5-x-template-fails-to-start

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