【发布时间】:2021-02-03 15:16:30
【问题描述】:
我试图弄清楚如何将我在 C# + .NET core 3.1 中制作的工具作为易于运行的 Mac .app 文件部署给我的同事。该应用程序已制作完成,我已将其作为独立应用程序发布,因此他们无需安装 .NET 核心,但我在将 120 多个文件放入单个 .app 文件时遇到了问题。
我尝试使用 Info.plist 手动执行此操作,但是当我尝试将其作为 .app 运行时,应用程序“意外崩溃”(仅运行可执行文件时工作正常)。
有没有一种简单的方法可以直接从 Visual Studio for Mac 甚至从命令行执行此操作?
这是我手动尝试的文件结构:
MyApp.app
Contents
Info.plist
MacOS
MyAppExecutable
(.net core files - DLLs, dylibs, etc)
Resources
icon.icms
这是我的Info.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleGetInfoString</key>
<string>MyApp</string>
<key>CFBundleExecutable</key>
<string>MyAppExecutable</string>
<key>CFBundleIdentifier</key>
<string>com.Random-app-developer.www</string>
<key>CFBundleName</key>
<string>MyApp</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundleShortVersionString</key>
<string>0.01</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>IFMajorVersion</key>
<integer>0</integer>
<key>IFMinorVersion</key>
<integer>1</integer>
</dict>
</plist>
知道我该怎么做吗?谢谢
【问题讨论】:
-
只是一个想法,你可以在这里使用single file publish
-
这对我的目的很有效@PavelAnikhouski,如果你想写一个答案以获得一些分数,请随意
标签: c# macos visual-studio .net-core console