dotnet-bundle
dotnet-bundle copied to clipboard
The target "BundleApp" does not exist in the project.
I've added the nuget package to my project. Then I've added the following lines to my csproj file:
<PropertyGroup>
<CFBundleName>AppName</CFBundleName> <!-- Also defines .app file name -->
<CFBundleDisplayName>App Name</CFBundleDisplayName>
<CFBundleIdentifier>com.example</CFBundleIdentifier>
<CFBundleVersion>1.0.0</CFBundleVersion>
<CFBundlePackageType>APPL</CFBundlePackageType>
<CFBundleSignature>????</CFBundleSignature>
<CFBundleExecutable>AppName</CFBundleExecutable>
<CFBundleIconFile>icon.icns</CFBundleIconFile> <!-- Will be copied from output directory -->
<NSPrincipalClass>NSApplication</NSPrincipalClass>
</PropertyGroup>
and ran dotnet msbuild -t:BundleApp -p:RuntimeIdentifier=osx-x64 via commandline on my csproj file. But I receive this error: The target "BundleApp" does not exist in the project. What am I doing wrong?
I had the same issue but adding these worked:
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<RuntimeIdentifiers>osx-x64</RuntimeIdentifiers>
<CFBundleName>NftJsonGen</CFBundleName> <!-- Also defines .app file name -->
<CFBundleDisplayName>NftJsonGen</CFBundleDisplayName>
<CFBundleIdentifier>com.endomint</CFBundleIdentifier>
<CFBundleVersion>1.0.0</CFBundleVersion>
<CFBundleShortVersionString>1.0.0</CFBundleShortVersionString>
<OutputType>WinExe</OutputType>
<CFBundlePackageType>APPL</CFBundlePackageType>
<CFBundleExecutable>NftJsonGen</CFBundleExecutable>
<CFBundleIconFile>Logo.icns</CFBundleIconFile> <!-- Will be copied from output directory -->
<NSPrincipalClass>NSApplication</NSPrincipalClass>
<NSHighResolutionCapable>true</NSHighResolutionCapable>
</PropertyGroup>
I'm getting the same issue with these added project values.
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<RuntimeIdentifiers>osx-x64</RuntimeIdentifiers>
<CFBundleName>Player432hz</CFBundleName> <!-- Also defines .app file name -->
<CFBundleDisplayName>432hz Player</CFBundleDisplayName>
<CFBundleIdentifier>com.player432hz</CFBundleIdentifier>
<CFBundleVersion>2.1</CFBundleVersion>
<CFBundleShortVersionString>2.1</CFBundleShortVersionString>
<CFBundlePackageType>APPL</CFBundlePackageType>
<CFBundleSignature>????</CFBundleSignature>
<CFBundleExecutable>Player432hz</CFBundleExecutable>
<CFBundleIconFile>Player432hz.icns</CFBundleIconFile> <!-- Will be copied from output directory -->
<NSPrincipalClass>NSApplication</NSPrincipalClass>
<NSHighResolutionCapable>true</NSHighResolutionCapable>
<!-- Optional -->
<NSRequiresAquaSystemAppearance>true</NSRequiresAquaSystemAppearance>
</PropertyGroup>
After struggling with it myself for a while, you need to supply the -p:TargetFramework=net6.0 (or whatever framework you intend to publish) to the msbuild command when using <TargetFrameworks>...</TargetFrameworks>, since the task depends on the publish task, and the publish task requires a single framework to be selected