将.net core app发布到linux出现的错误

原文地址:https://stackoverflow.com/questions/48896443/an-assembly-specified-in-the-application-dependencies-manifest-was-not-fou


I upgraded Microsoft.AspNetCore from 2.0.3 to 2.0.5 and my WebAPI project, although running successfully locally, fails to start in production (IIS). Everything was fine in production until this upgrade. The error message produced in the log directory is as follows:

  1. Error:
  2. An assembly specified in the application dependencies manifest (MyProject.WebAPI.deps.json) was not found:
  3. package: 'Microsoft.AspNetCore.Mvc.Abstractions', version: '2.0.2'
  4. path: 'lib/netstandard2.0/Microsoft.AspNetCore.Mvc.Abstractions.dll'
  5. This assembly was expected to be in the local runtime store as the application was published using the following target manifest files:
  6. aspnetcore-store -2.0 .5.xml

Could someone explain to me the details of exactly what this means? I assume it's a version mismatch of sorts, but why is this occurring? I thought the latest stable releases of NuGet packages weren't supposed to have such issues.

I was able to resolve the issue by downgrading Microsoft.AspNetCore.All from 2.0.5 to 2.0.3, but would like to find a better solution to the issue so I can use the most up-to-date version of this package.

Development machines usually have the SDK installed but on production the runtime only.

Add the following to your .csproj file and publish again.

  1. <PropertyGroup>
  2. <PublishWithAspNetCoreTargetManifest>false </PublishWithAspNetCoreTargetManifest>
  3. </PropertyGroup>

GitHub 加速计划 / de / Dependencies
36
1
下载
A rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues.
最近提交(Master分支:18 天前 )
1997a400 - 3 年前
2f423539 - 3 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐