我正在将一些应用程序从.NET Core 1.1更新到2.0.应用程序在本地运行良好,但在我的Linux VM上更新运行时并进行部署后,我收到错误:An assembly specified in the application dependencies manifest(foo.deps.json) w...

我正在将一些应用程序从.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可执行文件并行.
本文标题为:仅在.NET Core 2.0运行时的Linux上缺少运行时存储库错误


基础教程推荐
- 实例详解C#实现http不同方法的请求 2022-12-26
- C# 解析XML和反序列化的示例 2023-04-14
- c# – USING块在网站与Windows窗体中的行为不同 2023-09-20
- C#通过标签软件Bartender的ZPL命令打印条码 2023-05-16
- C#调用摄像头实现拍照功能的示例代码 2023-03-09
- C#中的Linq to JSON操作详解 2023-06-08
- C#中 Json 序列化去掉null值的方法 2022-11-18
- C#获取指定目录下某种格式文件集并备份到指定文件夹 2023-05-30
- Unity 如何获取鼠标停留位置下的物体 2023-04-10
- Unity shader实现高斯模糊效果 2023-01-16