2017-02-23 76 views
10

試圖從碼頭工人形象運行我的應用程序時,我收到以下錯誤:在找不到搬運工圖像應用洞察依賴DOTNET後發佈

Error: assembly specified in the dependencies manifest was not found -- package: 'Microsoft.ApplicationInsights.AspNetCore', version: '1.0.2', path: 'lib/netstandard1.6/Microsoft.ApplicationInsights.AspNetCore.dll' 

泊塢窗圖像是基於microsoft/aspnetcore

使用dotnet restoredotnet publish泊塢窗圖像上microsoft/aspnetcore-build:1.1.0-projectjson

{app}.deps.json,其中建在"targets"的文件,我有:

"Microsoft.ApplicationInsights.AspNetCore/1.0.2": { 
    "dependencies": { 
     "Microsoft.ApplicationInsights": "2.1.0", 
     "Microsoft.AspNetCore.Hosting.Abstractions": "1.0.0", 
     "Microsoft.AspNetCore.Http.Abstractions": "1.0.0", 
     "Microsoft.AspNetCore.Mvc.ViewFeatures": "1.0.1", 
     "Microsoft.Extensions.Configuration": "1.0.0", 
     "Microsoft.Extensions.DiagnosticAdapter": "1.0.0", 
     "Microsoft.Extensions.Logging.Abstractions": "1.0.0", 
     "System.Net.NameResolution": "4.3.0" 
    }, 
    "runtime": { 
     "lib/netstandard1.6/Microsoft.ApplicationInsights.AspNetCore.dll": {} 
    }, 
    "compile": { 
     "lib/netstandard1.6/Microsoft.ApplicationInsights.AspNetCore.dll": {} 
    } 
    }, 

我沒有lib文件夾在我發表的輸出,但我有Microsoft.ApplicationInsights.AspNetCore位於我發佈的輸出的根目錄。

我覺得我失去了一些明顯的東西。任何幫助,將不勝感激。

更新:

更新應用洞察2.0.0沒有影響。

刪除Application Insights將問題簡單地移到另一個程序集。

切換到獨立部署不起作用。

新增COREHOST_TRACE=1並取得了以下的輸出:

Processing TPA for deps entry [Microsoft.ApplicationInsights.AspNetCore, 2.0.0, lib/netstandard1.6/Microsoft.ApplicationInsights.AspNetCore.dll] 
    Considering entry [Microsoft.ApplicationInsights.AspNetCore/2.0.0/lib/netstandard1.6/Microsoft.ApplicationInsights.AspNetCore.dll] and probe dir [/packagescache/x64] 
The hash file is invalid [/packagescache/x64/Microsoft.ApplicationInsights.AspNetCore/2.0.0/Microsoft.ApplicationInsights.AspNetCore.2.0.0.nupkg.sha512] 
    Skipping... match hash failed 
    Considering entry [Microsoft.ApplicationInsights.AspNetCore/2.0.0/lib/netstandard1.6/Microsoft.ApplicationInsights.AspNetCore.dll] and probe dir [/packagescache] 
The hash file is invalid [/packagescache/Microsoft.ApplicationInsights.AspNetCore/2.0.0/Microsoft.ApplicationInsights.AspNetCore.2.0.0.nupkg.sha512] 
    Skipping... match hash failed 
Error: assembly specified in the dependencies manifest was not found -- package: 'Microsoft.ApplicationInsights.AspNetCore', version: '2.0.0', path: 'lib/netstandard1.6/Microsoft.ApplicationInsights.AspNetCore.dll' 
+0

可能相關嗎?你是如何發佈的? http://stackoverflow.com/questions/38796439/how-to-include-dependencies-in-net-core-app-docker-image?rq=1 –

+0

你找到了答案嗎? – bdparrish

回答

7

我通過執行在發佈文件夾中的應用程序解決了這個問題。舉例來說,如果你是在發佈的Ubuntu 16.04發佈模式在.NET 1.1的核心應用程序,您發佈的文件將在

\ BIN \發佈\ netcoreapp1.1 \ ubuntu.16.04-64

此目錄中有一個可執行文件,但這不是您要使用的可執行文件。實際上,你需要去一個目錄更深,在

\ BIN \發佈使用可執行\ netcoreapp1.1 \ ubuntu.16.04-64 \發佈

0

我有一個類似的問題,我跑ASPNET核心應用程序在Docker容器中。我已經從Dotnet核心1.1升級到aspnet核心2.

我必須更改我的Dockerfile基地使用Microsoft/aspnet而不是Microsoft/Dotnet作爲Dotnet基地沒有所有的aspnet庫。