【发布时间】:2020-10-11 06:29:57
【问题描述】:
未处理的异常。 System.IO.FileNotFoundException:无法加载文件或程序集“Microsoft.AspNetCore.Hosting.Abstractions,版本=3.1.0.0,文化=中性,PublicKeyToken=adb9793829ddae60”。该系统找不到指定的文件。 文件名:'Microsoft.AspNetCore.Hosting.Abstractions, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
我正在使用 aws 将我的项目部署到服务器 (.NetCore 3.1)。我遇到了错误。但在本地 iis 中工作正常。
我尝试安装“Microsoft.AspNetCore.Hosting.Abstractions”。但我仍然面临同样的问题。
请在下面找到包参考
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EPPlus" Version="5.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="3.1.5" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="4.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.6" />
<PackageReference Include="MongoDB.Driver" Version="2.10.3" />
<PackageReference Include="Nancy" Version="2.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.4.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Helpers\Helpers.csproj" />
<ProjectReference Include="..\Models\Models.csproj" />
<ProjectReference Include="..\Repository\Repository.csproj" />
<ProjectReference Include="..\Services\Services.csproj" />
</ItemGroup>
</Project>
关于同样的错误,我经历了几个link。我尝试了所有方法。但我仍然遇到同样的问题。
【问题讨论】:
-
各位大侠帮帮我
-
您是否在 AWS 中安装了最新的虚拟主机捆绑包?
-
@JokiesDing 我不确定,因为我没有处理这个服务器。但是我提取了 dll,然后我才知道在服务器中没有最新版本的“Microsoft.AspNetCore.Hosting.Abstractions”(Assembly Microsoft.AspNetCore.Hosting.Abstractions,Version=2.2.0.0,Culture=neutral,PublicKeyToken=adb9793829ddae60 ) 但在我的本地 (Assembly Microsoft.AspNetCore.Hosting.Abstractions, Version=3.1.4.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)。希望我认为服务器中没有最新版本
-
听起来AWS上的.net core版本是.net core 2.2。那么,您是否在该 AWS 服务器上安装了 3.1 和托管包?
-
是的,在服务器 3.1 中存在。
标签: c# iis asp.net-web-api asp.net-core-3.1 .net-core-3.1