我想通過Travis CI部署一個dotnet核心web應用程序到Ubuntu VPS。我在使用dotnet restore && dotnet publish -c release -r ubuntu.16.04-x64
構建服務器之前。構建和部署在Travis上完成的很好,但是當我在服務器上重新啓動應用程序服務時,出現如下所示的錯誤。'dotnet發佈'錯誤引用依賴關係在不存在的lib目錄中
Error: assembly specified in the dependencies manifest was not found -- package: 'microsoft.aspnetcore.antiforgery', version: '1.1.1', path: 'lib/netstandard1.3/Microsoft.AspNetCore.Antiforgery.dll'
該被作爲對發佈的一部分創建的*.deps.json
文件具有系如下面的那些。
"microsoft.aspnetcore.antiforgery/1.1.1": {
"dependencies": {
"Microsoft.AspNetCore.DataProtection": "1.1.1",
"Microsoft.AspNetCore.Http.Abstractions": "1.1.1",
"Microsoft.AspNetCore.Http.Extensions": "1.1.1",
"Microsoft.AspNetCore.WebUtilities": "1.1.1",
"Microsoft.Extensions.ObjectPool": "1.1.0",
"NETStandard.Library": "1.6.1"
},
"compile": {
"lib/netstandard1.3/Microsoft.AspNetCore.Antiforgery.dll": {}
}
},
"microsoft.aspnetcore.authorization/1.1.1": {
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "1.1.1",
"Microsoft.Extensions.Options": "1.1.1",
"NETStandard.Library": "1.6.1",
"System.Security.Claims": "4.3.0"
},
"compile": {
"lib/netstandard1.3/Microsoft.AspNetCore.Authorization.dll": {}
}
},
那些「編譯」的屬性是什麼原因造成的問題,因爲如果我手動刪除編譯屬性爲lib/netstandard1.3/Microsoft.AspNetCore.Antiforgery.dll
,錯誤現在變成:
Error: assembly specified in the dependencies manifest was not found -- package: 'microsoft.aspnetcore.authorization', version: '1.1.1', path: 'lib/netstandard1.3/Microsoft.AspNetCore.Authorization.dll'
爲什麼這些編譯屬性得到在*.deps.json
文件中創建?他們需要嗎?如果是這樣,爲什麼目錄沒有創建時,我dotnet publish
?如果沒有,我如何刪除它們以便我的應用程序運行?
謝謝。
謝謝你,真是一個驚喜。 – Kugel