bartonm
bartonm

Reputation: 1650

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?

The below documentation does not readily suggest what I'm looking for: https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets

Is there another msbuild property that I can specify?

Something like IncludeAllFilesFromBuildOutputInPackage

That could be declared in the property group like below:

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

Upvotes: 0

Views: 42

Answers (1)

Martin Ullrich
Martin Ullrich

Reputation: 100751

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. These packages contain all dependencies inside a tool folder in the NuGet package.

There are also web deployment publish profiles that can instruct tooling to generate a zip file, but those are specific to web applications.

Note that NuGet is not a really deployment tool, but a dependency management system. Using it for deployment scenarios isn't supported out of the box, which is why you don't find such features readily available.

Upvotes: 0

Related Questions