asp.net core发布到docker报Microsoft.ApplicationInsights.AspNetCore miss的错误
程序员文章站
2022-04-20 23:08:07
dotnet core 2.1的asp.net core在docker下部署的时候发生下面的错误。 Error: An assembly specified in the application dependencies manifest (MyApp.deps.json) was not foun ......
dotnet core 2.1的asp.net core在docker下部署的时候发生下面的错误。
Error:
An assembly specified in the application dependencies manifest (MyApp.deps.json) was not found:
package: 'Microsoft.ApplicationInsights.AspNetCore', version: '2.1.1'
path: 'lib/netstandard1.6/Microsoft.ApplicationInsights.AspNetCore.dll'
解决办法是手动publish加上参数把'Microsoft.ApplicationInsights.AspNetCore这个包不要包含进去。
dotnet publish /property:PublishWithAspNetCoreTargetManifest=false
搞不懂微软,干嘛默认集成这个包,这个包是用来搞智能监控的,貌似没什么用。关键是集成进去跟2.1的Runtime环境又不太一样。哎。。。