僅具有 .NET Core 2.0 執行時的 Linux 上缺少執行時儲存錯誤
我正在將一些應用程序從 .NET Core 1.1 更新到 2.0。這些應用程序在本地執行良好,但在我的 linux VM 上更新執行時並部署後,我收到錯誤:
找不到應用程序依賴項清單 (foo.deps.json) 中指定的程序集:包:‘Microsoft.ApplicationInsights.AspNetCore’,版本:‘2.1.1’ 路徑:’lib/netstandard1.6/Microsoft.ApplicationInsights.AspNetCore .dll’
該程序集應位於本地執行時儲存中,因為應用程序是使用以下目標清單文件發布的: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
我認為這是因為執行時下載不會生成使用 Microsoft.AspNetCore.All 包時所需的新執行時儲存文件夾。
我可以安裝整個 SDK,這工作正常,但我寧願繼續只使用執行時。
如何在不需要生產伺服器上的 SDK 的情況下手動生成執行時記憶體?
2017 年 12 月 4 日更新
ASP.NET Core 執行時現在列在 .NET Core 的主下載頁面上。https://www.microsoft.com/net/download/linux
2017 年 10 月 3 日更新
您也可以從包源安裝。
有關為 apt、yum、zypper 等添加 .NET Core 包源的說明,請參閱此連結:https ://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.0 -download.md#installing-net-core-on-linux
例如,如果你想在 Ubuntu 16 上安裝,你可以這樣做:
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list' sudo apt update sudo apt install aspnetcore-store-2.0.0原始答案
您可以從此處僅下載 ASP.NET Core 執行時儲存:
https://dist.asp.net/runtimestore/2.0.0/linux-x64/aspnetcore.runtimestore.tar.gz
您還需要下載 .NET Core 2.0.0 執行時(請參閱https://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.0-download.md)。
將這兩者提取到同一個文件夾中,即執行時儲存存檔中的“store”和“additionalDeps”文件夾應該與 dotnet 執行檔平行。