系统相关
首页 > 系统相关> > 仅在.NET Core 2.0运行时的Linux上缺少运行时存储库错误

仅在.NET Core 2.0运行时的Linux上缺少运行时存储库错误

作者:互联网

我正在将一些应用程序从.NET Core 1.1更新到2.0.应用程序在本地运行良好,但在我的Linux VM上更新运行时并进行部署后,我收到错误:

An assembly specified in the application dependencies manifest
(foo.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

我认为这是因为运行时下载不会生成使用Microsoft.AspNetCore.All包时所需的新运行时存储文件夹.

我可以安装整个SDK,这样可以正常工作但我宁愿继续只使用运行时.

如何在生产服务器上不需要SDK的情况下手动生成运行时缓存?

解决方法:

更新12/4/2017

ASP.NET Core运行时现在列在.NET Core的主要下载页面上. https://www.microsoft.com/net/download/linux

更新10/3/2017

您也可以从包源安装.

有关为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可执行文件并行.

标签:linux,asp-net-core,net,asp-net-core-2-0
来源: https://codeday.me/bug/20191008/1870030.html