ASP.NET 核心 MVC:定位的程序集的清单定义与程序集引用不匹配
ASP.NET Core MVC: The located assembly's manifest definition does not match the assembly reference
我尝试将我的 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'
它在本地有效,但在服务器上无效。
我发现这个 线程关于这个问题,但接受的答案是针对 .net Framework,而不是 .net core(没有用,我试过了),后来的答案是关于我不使用的 Azure 功能。
我用的是net core 3.1
所以,这可能是一个菜鸟错误:
我使用 Core 3.1,但 NuGet 添加了 5.0
的引用
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0.0" />
降级到3.1.14版本后,一切正常
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.14" />
我尝试将我的 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'
它在本地有效,但在服务器上无效。
我发现这个
我用的是net core 3.1
所以,这可能是一个菜鸟错误: 我使用 Core 3.1,但 NuGet 添加了 5.0
的引用<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0.0" />
降级到3.1.14版本后,一切正常
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.14" />