.net-core自包含发布问题 [英] Problems with .net-core self contained publish

查看:556
本文介绍了.net-core自包含发布问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图发布一个独立于.net-core的应用程序,按照 https://docs.microsoft.com/en-us/dotnet/articles/core/deploying/index



具有代码的存储库位于 https://github.com/fontanaricardo/httpecho



我执行命令:

  $ dotnet build -r debian。 8-x64 
$ dotnet publish -c Release -r debian.8-x64
$ docker build -t httpecho。

启动容器:

  $ docker run -p 5000:5000 httpecho 
错误:在依赖性清单中指定的程序集未找到 - package:'Microsoft.AspNetCore.Hosting.Abstracti
ons'版本:'1.1.0',路径:'lib / netstandard1.3 / Microsoft.AspNetCore.Hosting.Abstractions.dll'

我做错了?



更新



打开文件 http://www.ecurity.hk/http/http://cn/http://tv.http: c>运行时:{
lib / netstandard1.3 / Microsoft.AspNetCore.Http.Abstractions.dll:{}
}


解决方案

您的设备在您的自包含发布中尝试使用适当的distibute包(在我的工作良好)上有问题。尝试修复软件包 dotnet restore



有没有 Microsoft.AspNetCore.Http.Abstractions debian.8-x64\publish 中的.dll ?如果没有尝试手动添加(和所有其他缺少* .dll的),然后尝试运行。如果它会运行没有错误将是正确的distibute包


的问题

I`m trying to publish a self-contained app, made in .net-core, following the steps in https://docs.microsoft.com/en-us/dotnet/articles/core/deploying/index.

The repository with the code is in https://github.com/fontanaricardo/httpecho

I execute the commands:

$dotnet build -r debian.8-x64
$dotnet publish -c Release -r debian.8-x64
$docker build -t httpecho .

Starting the container:

$ docker run -p 5000:5000 httpecho
Error: assembly specified in the dependencies manifest was not found -- package: 'Microsoft.AspNetCore.Hosting.Abstracti
ons', version: '1.1.0', path: 'lib/netstandard1.3/Microsoft.AspNetCore.Hosting.Abstractions.dll'

I'm doing something wrong?

Update

Open the file httpecho.deps.json, in publish folder, references the folder that not exists.

"runtime": {
      "lib/netstandard1.3/Microsoft.AspNetCore.Http.Abstractions.dll": {}
    }

解决方案

Your device have problem with proper distibute packages into your self contained publish (tried on my worked well). Try to fix packages by dotnet restore

Is there Microsoft.AspNetCore.Http.Abstractions.dll in debian.8-x64\publish? If not try to add manually (and all other missing *.dll's) and then try to run. If it will run without errors will be problem with proper distibute packages

这篇关于.net-core自包含发布问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆