简体   繁体   English

使用dotnetcore pack创建一个部署nuget软件包。

[英]Create a deployment nuget package with `dotnetcore pack`

Using dotcore pack with msbuild, is there a Property that can instruct packaging logic to include ALL files in the output folder? 将dotcore pack与msbuild一起使用时,是否有一个属性可以指示打包逻辑将所有文件包括在输出文件夹中?

The below documentation does not readily suggest what I'm looking for: https://docs.microsoft.com/en-us/nuget/reference/msbuild-targets 下面的文档不能轻易建议我要寻找的内容: https : //docs.microsoft.com/zh-cn/nuget/reference/msbuild-targets

Is there another msbuild property that I can specify? 我可以指定另一个msbuild属性吗?

Something like IncludeAllFilesFromBuildOutputInPackage 诸如IncludeAllFilesFromBuildOutputInPackage东西

That could be declared in the property group like below: 可以在属性组中声明如下:

 <Project Sdk="Microsoft.NET.Sdk">
  ...
  <PropertyGroup>
    <IncludeAllFilesFromBuildOutputInPackage>true</IncludeAllFilesFromBuildOutputInPackage>
  </PropertyGroup>
  ...
</Project>

In theory, there is is the <PackAsTool>true</…> property that will instruct it to pack executables as tool executables to be installed via dotnet tool install . 从理论上讲,有一个<PackAsTool>true</…>属性将指示它将可执行文件打包为要通过dotnet tool install工具可执行文件。 These packages contain all dependencies inside a tool folder in the NuGet package. 这些软件包在NuGet软件包的工具文件夹中包含所有依赖项。

There are also web deployment publish profiles that can instruct tooling to generate a zip file, but those are specific to web applications. 也有Web部署发布配置文件,可以指示工具生成zip文件,但这些配置文件特定于Web应用程序。

Note that NuGet is not a really deployment tool, but a dependency management system. 请注意,NuGet并不是真正的部署工具,而是依赖性管理系统。 Using it for deployment scenarios isn't supported out of the box, which is why you don't find such features readily available. 开箱即用不支持使用它进行部署,这就是为什么您找不到这样的功能的原因。

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

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