Packaging utilities for .NET Core
This repository contains command-line extensions for the .NET Core CLI which make it easy to create
deployment packages (such as
.zip files, tarballs or installers) for .NET Core applications.
The following commands are already available:
dotnet tarball- Create a
.tar.gzfile for Linux and OS X
dotnet rpm- Create a CentOS/RedHat Linux installer
dotnet zip- Create a
These commands are currently in development:
dotnet deb- Create a Ubuntu/Debian Linux installer
And finally these are up next:
dotnet choco- Create a Chocolatey package
dotnet msi- Create a Windows Installer (msi) package
dotnet pkg- Create a macOS installer
Did we miss anything? Feel free to file a feature request, or send a PR!
Add the following entry to your
.csproj file, under the
Project node. You do not need to add all
only add those you are going to use.
<ItemGroup> <PackageReference Include="Packaging.Targets" Version="0.1.1-*" /> <DotNetCliToolReference Include="dotnet-tarball" Version="0.1.1-*" /> <DotNetCliToolReference Include="dotnet-zip" Version="0.1.1-*" /> <DotNetCliToolReference Include="dotnet-rpm" Version="0.1.1-*" /> </ItemGroup>
From the command line, run
dotnet zip or
dotnet tarball to create a
.tar.gz archive of the published output of your project.
All commands take the following command line arguments:
--runtime: Required. The target runtime has to be specified in the project file. For example,
--framework: Required. The target framework has to be specified in the project file. For example,
--configuration: Target configuration. The default for most projects is 'Debug'.
---version-suffix: Defines the value for the
$(VersionSuffix)property in the project.
If you have multiple
.csproj files in a single directory, .NET Core CLI tools don't work.
If that's the case, you can still invoke the packaging tools manually:
dotnet msbuild [your-project].csproj /t:CreateZip /p:TargetFramework=netcoreapp1.1 /p:RuntimeIdentifier=win7-x64 /p:Configuration=Release