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.

share improve this question
add a comment

Answer

active oldest votes

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>
share improve this answer

你可能感兴趣的:(asp.net,core)