ASP.NET 样板 MVC 5.x 模板无法启动

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

下载 ASP.NET MVC 5.x 模板后,我更新了连接字符串,恢复了 NuGet 包,然后尝试在包管理器控制台中执行 运行 Update-Database 命令,但是我一直收到以下错误:

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)

我曾经通过删除所有软件包并一次添加一个来解决这个问题,但这非常耗时。

我在 Angular 和多页版本上都有过同样的经历,我使用的是 VS2017 Community。

我做错了什么?

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>

您可以删除该绑定重定向。