Avalonia发布MacOS运行程序

1 打开xxx.csproj项目文件,添加Dotnet.Bundle包;

<PackageReference Include="Dotnet.Bundle" Version="*" />

2 在xxx.csproj中添加配置;

复制代码
<CFBundleName>xxx</CFBundleName> <!-- Also defines .app file name -->
    <CFBundleDisplayName>xxx</CFBundleDisplayName>
    <CFBundleIdentifier>com.laiger.ios</CFBundleIdentifier>
    <CFBundleVersion>1.0.0</CFBundleVersion>
    <CFBundlePackageType>AAPL</CFBundlePackageType>
    <CFBundleSignature>????</CFBundleSignature>
    <CFBundleExecutable>xxx</CFBundleExecutable>
    <CFBundleIconFile>xxx.icns</CFBundleIconFile> <!-- Will be copied from output directory -->
    <CFBundleShortVersionString>1.0</CFBundleShortVersionString>
    <NSPrincipalClass>NSApplication</NSPrincipalClass>
    <NSHighResolutionCapable>true</NSHighResolutionCapable>
复制代码

3 执行发部命令;

dotnet restore -r osx-x64

dotnet msbuild -t:BundleApp -p:RuntimeIdentifier=osx-x64  -property:Configuration=Release

4 将xxx.app文件拷贝到MacOs电脑上,并执行授权命令;

chmod +x xxx.app/Contents/MacOS/TestApp 

 引用:Mac OS 部署Avalonia+.Net Core项目 - 灰信网(软件开发博客聚合) (freesion.com)

posted @   趋时软件  阅读(539)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
点击右上角即可分享
微信分享提示