.NET Core 2.0 应用程序作为 deb 文件发布



是否可以将已发布的.NET Core 2.0应用程序转换为.deb文件?我通过dotnet publish -c Release -r ubuntu.16.04-x64发布了我的应用程序。现在,我的目标是拥有一个可以安装在 Ubuntu 机器上的 deb 文件。

如果要为 .NET Core 应用程序创建.deb包,可以使用 dotnet-deb

要安装 dotnet-deb ,请将以下引用添加到.csproj文件中:

<ItemGroup>
    <PackageReference Include="Packaging.Targets" Version="0.1.1-*" />
    <DotNetCliToolReference Include="dotnet-deb" Version="0.1.1-*" />
</ItemGroup>

然后,运行dotnet restoredotnet publish -c Release -f netcoreapp2.0 -r ubuntu.16.04-x64。这将为您生成一个 Debian 安装包。

我是dotnet-deb的维护者,如果您有任何问题,请随时提出后续问题或前往 https://github.com/qmfrederik/dotnet-packaging。

看起来你想要 https://github.com/qmfrederik/dotnet-packaging!它提供了像dotnet deb这样的命令,可以将你的项目打包成Linux的deb/rpm/tar。

最新更新