No icon when dotnet publish .net maui mac catalyst app

76 views Asked by At

When I use this command to publish a .net maui Mac catalyst app for Ad Hoc

dotnet publish ChronoWiz/ChronoWiz.csproj -f net8.0-maccatalyst -c Release -p:MtouchLink=SdkOnly -p:CreatePackage=true -p:EnableCodeSigning=true -p:CodesignKey="Apple Development: Eigil Krogh (M39X...)" -p:CodesignProvision="ChronoWiz Profile Development MAC" -p:CodesignEntitlements="Platforms\MacCatalyst\Entitlements.Release.plist" -p:UseHardenedRuntime=true -o "/Applications"

or this command to publish a .net maui Mac catalyst app for App Store

dotnet publish ChronoWiz/ChronoWiz.csproj -f net8.0-maccatalyst -c Release -p:MtouchLink=SdkOnly -p:CreatePackage=true -p:EnableCodeSigning=true -p:EnablePackageSigning=true -p:CodesignKey="Apple Distribution: Eigil Krogh (4657Q2...)" -p:CodesignProvision="ChronoWiz Profile App Store MAC" -p:CodesignEntitlements="Platforms\MacCatalyst\Entitlements.Release.plist" -p:PackageSigningKey="3rd Party Mac Developer Installer: Eigil Krogh (4657Q...)" -o "/Applications"

Then the resulting app, ChronoWix.apps" has no icon.

What can be the reason for that. If I run the following command, the .app has icons.

dotnet build ChronoWiz/ChronoWiz.csproj -f net8.0-maccatalyst

2

There are 2 answers

0
Arseniy K On

You need to check that the names of the icons in .csproj and Info.plist match. For example, for icon "micon1.svg" in Info.plist must be:

    <key>XSAppIconAssets</key>
    <string>Assets.xcassets/micon1.appiconset</string>

Info.plist

.csproj

0
Eigil Krogh Sorensen On

The solution for me is: Enter the name of the icon file in ...Platforms/MacCatalyst/Info.plist like this:

<key>CFBundleIconFile</key>
<string>appicon</string>
<key>CFBundleIconName</key>
<string>appicon</string>