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

查看:52
本文介绍了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天全站免登陆