.NET Core 2.0应用程序发布为deb文件
是否可以将已发布的.NET Core 2.0应用程序转换为.deb文件?
我通过dotnet publish -c Release -r ubuntu.16.04-x64
发布了我的应用.现在,我的目标是拥有一个可以在Ubuntu计算机上安装的deb文件.
Is it possible to transform published .NET Core 2.0 application to .deb file?
I published my app by dotnet publish -c Release -r ubuntu.16.04-x64
. Now, my goal is to have a deb file that can be installed on Ubuntu machine.
如果要为.NET Core应用程序创建.deb
程序包,则可以使用dotnet-deb
.
If you want to create .deb
packages for your .NET Core applications, you can use dotnet-deb
.
要安装dotnet-deb
,请在.csproj
文件中添加以下引用:
To install dotnet-deb
, add the following references to your .csproj
file:
<ItemGroup>
<PackageReference Include="Packaging.Targets" Version="0.1.1-*" />
<DotNetCliToolReference Include="dotnet-deb" Version="0.1.1-*" />
<ItemGroup>
<ItemGroup>
<PackageReference Include="Packaging.Targets" Version="0.1.1-*" />
<DotNetCliToolReference Include="dotnet-deb" Version="0.1.1-*" />
<ItemGroup>
然后,运行dotnet restore
和dotnet publish -c Release -f netcoreapp2.0 -r ubuntu.16.04-x64
.这将为您生成一个Debian安装程序包.
Then, run dotnet restore
and dotnet publish -c Release -f netcoreapp2.0 -r ubuntu.16.04-x64
. This will generate a Debian installer package for you.
我是dotnet-deb
的维护者,可以随时提出后续问题,或者直接去如果有疑问,请https://github.com/qmfrederik/dotnet-packaging .
I'm the maintainer for the dotnet-deb
, feel free to ask follow up questions or head over to https://github.com/qmfrederik/dotnet-packaging if you have questions.