You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While attempting to publishing a self-contained single executable file, targeting net9.0-macos, the MSBuild publish target fails with:
/usr/local/share/dotnet/packs/Microsoft.macOS.Sdk.net9.0_15.2/15.2.9173/targets/Xamarin.Shared.Sdk.targets(1903,3): warning : The file '/Users/ztl8702/Documents/ScratchProjects/SignedApp/obj/Release/net9.0-macos/osx-x64/singlefilehost' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle.
/usr/local/share/dotnet/sdk/9.0.102/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Publish.targets(1116,5): error MSB4018:
The "GenerateBundle" task failed unexpectedly.
System.ArgumentException: Invalid input specification: Must specify the host binary
at Microsoft.NET.HostModel.Bundle.Bundler.GenerateBundle(IReadOnlyList`1 fileSpecs)
at Microsoft.NET.Build.Tasks.GenerateBundle.ExecuteCore()
at Microsoft.NET.Build.Tasks.TaskBase.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, Ta
skHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
Your test project is typical macos app with the UI. It can't be built as a single file due to macOS limitations. The macOS application is typically represented by so called application bundle, which is a folder with the .app extension.
So, net-macos will produce such an app bundle on build (no need to call publish at all) and the PublishSingleFile=true just not supported (and even the net sdk will somehow support it, such an app will not run on macOS).
So, just run dotnet build -c release then grab app bundle from the /bin/Relese folder. Additionally, this will produce multi-platform bundle, so it will work both on intel-based and arm-based mac.
Apple platform
macOS
Framework version
net9.0-*
Affected platform version
.NET 9.0.102
Description
While attempting to publishing a self-contained single executable file, targeting
net9.0-macos
, the MSBuild publish target fails with:Steps to Reproduce
repro.zip
dotnet publish -c Release -r osx-x64 -p:PublishSingleFile=true -p:UseAppHost=true
Did you find any workaround?
Not yet.
Build logs
msbuild.binlog.zip
The text was updated successfully, but these errors were encountered: