简体   繁体   English

如何在发布中包含asp.net core 2依赖项

[英]How to include asp.net core 2 dependencies in publish

I have an asp.net core application. 我有一个asp.net核心应用程序。 I publish the project to a folder and then sync the files to a linux production server. 我将项目发布到一个文件夹,然后将文件同步到Linux生产服务器。

All was working fine with asp.net core 1.x. 一切都与asp.net核心1.x一起正常工作。

After upgrading to 2.0, using the Microsoft.AspNetCore.All metapackage, the asp.net core dependencies are not published to the output. 升级到2.0后,使用Microsoft.AspNetCore.All元数据包,asp.net核心依赖项不会发布到输出。 I use <RuntimeIdentifiers>debian-x64</RuntimeIdentifiers> to create a self-contained publish, and nothing changes. 我使用<RuntimeIdentifiers>debian-x64</RuntimeIdentifiers>来创建一个自包含的发布,并且没有任何更改。

The linux server should not access internet and therefore it cannot download the dependencies. Linux服务器不应该访问Internet,因此无法下载依赖项。

How can I include all the dependencies in the published files? 如何在发布的文件中包含所有依赖项?

.NET Core 2.0有一个新的linux-x64运行时标识符,您应该为其发布。

dotnet publish -r linux-x64

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM