Error:
An assembly specified in the application dependencies manifest (XXXX.deps.json) was not found:
package: 'Microsoft.ApplicationInsights.AspNetCore', version: '2.1.1'
path: 'lib/netstandard1.6/Microsoft.ApplicationInsights.AspNetCore.dll'
This assembly was expected to be in the local runtime store as the application was published using the following target manifest files:
aspnetcore-store-2.0.0-linux-x64.xml;aspnetcore-store-2.0.0-osx-x64.xml;aspnetcore-store-2.0.0-win7-x64.xml;aspnetcore-store-2.0.0-win7-x86.xml
原因:
是asp.net 没有把服务器需要的包全部发布出来,它认为是目标系统带着有,而实际上目标系统中没有。
解决办法:
增加如下一行到 csjproj文件中即可:<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
最后csjproj文件看上去像这个样子:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>