An assembly specified in the application dependencies manifest (…) was not found

将.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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值