ASP.NET Boilerplate MVC 5.x 模板无法启动 [英] ASP.NET Boilerplate MVC 5.x template fails to start

查看:24
本文介绍了ASP.NET Boilerplate MVC 5.x 模板无法启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下载 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)

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.

我对 Angular 和 Multipage 版本都有同样的体验,我正在使用 VS2017 社区.

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

我做错了什么?

推荐答案

在 Web 项目的 web.config 中,它显示:

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.

这篇关于ASP.NET Boilerplate MVC 5.x 模板无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆