dotnet-bundle icon indicating copy to clipboard operation
dotnet-bundle copied to clipboard

The target "BundleApp" does not exist in the project.

Open 0x90d opened this issue 4 years ago • 3 comments

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?

0x90d avatar Aug 03 '21 14:08 0x90d

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>

McoreD avatar Jan 28 '22 23:01 McoreD

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>

mysteryx93 avatar Jul 05 '22 02:07 mysteryx93

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

ardittristan avatar Aug 03 '22 13:08 ardittristan