[英]ASP.NET Core MVC: The located assembly's manifest definition does not match the assembly reference
I tried to deploy my Asp.net core mvc projekt to our server, but the ISS only logs this error我尝试将我的 Asp.net 核心 mvc 项目部署到我们的服务器,但 ISS 仅记录此错误
System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
File name: 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
It does work localy, but not on the server.它可以在本地工作,但不能在服务器上工作。
I found this Could not load file or assembly Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.1.0.0 thread about the problem, but the accepted answer is for the .net Framework, not .net core (and did not work, I did try it) and the later answers are about Azure functions which I dont use.我发现这可能无法加载文件或程序集 Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.1.0.0线程关于该问题,但接受的答案是针对 .net 框架,而不是 .net 核心(并没有工作,我试过了) 后面的答案是关于我不使用的 Azure 函数。
I use net core 3.1我使用网络核心 3.1
So, this was probably a noob mistake: I use Core 3.1 but NuGet added the references for 5.0所以,这可能是一个菜鸟错误:我使用 Core 3.1 但 NuGet 添加了 5.0 的参考
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0.0" />
After downgrading to the 3.1.14 Version, everything降级到3.1.14版本后,一切
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.14" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.