首页 > 编程语言 >使用dotnet命令发布跨平台项目对应平台的程序包

使用dotnet命令发布跨平台项目对应平台的程序包

时间:2022-10-20 09:57:35浏览次数:53  
标签:CefNetDemo win 程序包 x64 跨平台 linux dotnet

通过命令创建跨平台项目对应平台的程序包:分别生成win-x64、linux-x64、osx-x64平台的程序包

win-x64:

在项目文件中新增配置:

<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>

执行命令:

dotnet restore 

dotnet msbuild -t:Publish -p:RuntimeIdentifier=win-x64 -p:Configuration=Release

linux-x64:

在项目文件中新增配置:

<RuntimeIdentifiers>linux-x64</RuntimeIdentifiers>

执行命令:

dotnet restore 

dotnet msbuild -t:Publish -p:RuntimeIdentifier=linux-x64 -p:Configuration=Release

osx-x64:

在项目文件中新增配置:

<RuntimeIdentifiers>osx-x64</RuntimeIdentifiers>
  <PropertyGroup Condition="'$(RuntimeIdentifiers)' == 'osx-x64'">
    <CFBundleName>CefNetDemo</CFBundleName>
    <CFBundleDisplayName>CefNetDemo</CFBundleDisplayName>
    <CFBundleIdentifier>gw.com.cn</CFBundleIdentifier>
    <CFBundleVersion>1.0.0</CFBundleVersion>
    <CFBundlePackageType>APPL</CFBundlePackageType>
    <CFBundleExecutable>CefNetDemo</CFBundleExecutable>
    <CFBundleIconFile>CefNetDemo.icns</CFBundleIconFile>
    <CFBundleShortVersionString>1.0.0.0</CFBundleShortVersionString>
    <NSPrincipalClass>CefNetDemo</NSPrincipalClass>
    <NSHighResolutionCapable>true</NSHighResolutionCapable>
  </PropertyGroup>
<PackageReference Condition="'$(RuntimeIdentifiers)' == 'osx-x64'" Include="Dotnet.Bundle" Version="*" />

执行命令:

dotnet restore 

dotnet msbuild -t:Publish -p:RuntimeIdentifier=linux-x64 -p:Configuration=Release

标签:CefNetDemo,win,程序包,x64,跨平台,linux,dotnet
From: https://www.cnblogs.com/cs569/p/16808681.html

相关文章