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

问题描述:

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

+0

你不需要* .deb。只需复制发布文件夹并通过'dotnet yourapp'运行应用程序 –

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

如果要为.NET核心应用程序创建.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