Description
Issue moved from dotnet/sdk#48041
- Please respond to @tuanchien.
From @tuanchien on Monday, March 31, 2025 9:51:15 PM
Describe the bug
On dotnet 9.0.202 sdk, when attempting to create a nuget package with the dotnet cli command
dotnet pack
for a maccatalyst project built with the Release config, it errors out failing to find the runtimeconfig.json file.
testnuget failed with 1 error(s) (0.1s)
/usr/local/share/dotnet/sdk/9.0.202/Sdks/NuGet.Build.Tasks.Pack/buildCrossTargeting/NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file '/Users/user/testnuget/bin/Release/net9.0-maccatalyst/testnuget.runtimeconfig.json' to be packed was not found on disk.
The maccatalyst build produces two directories
/Users/user/testnuget/bin/Release/net9.0-maccatalyst/maccatalyst-x64
and
/Users/user/testnuget/bin/Release/net9.0-maccatalyst/maccatalyst-arm64
both of which contain runtimeconfig.json
files so it appears the pack command is not accounting for the different runtime targets. Further evidence of this: if you copy the runtimeconfig file to the location the cli tool is expecting it to be, it will error out looking for the next file (the .dll assembly).
To Reproduce
- Create a template app with
dotnet new maui
- Optionally disable all other target frameworks other than
net9.0-maccatalyst
in the.csproj
(to speed up testing). - Run
dotnet build -c Release
- Run
dotnet pack
The debug build does not exhibit this problem, but it also only generates maccatalyst-arm64 instead of both x86_64 and arm64 like the release build does.
Exceptions (if any)
Further technical details
Primarily tested on mac with the following dotnet details. Quickly tested on the windows dotnet sdk, and it exhibits similar behaviour.
% dotnet --list-sdks
9.0.202 [/usr/local/share/dotnet/sdk]
tuan@michelangelo testnuget % dotnet --info
.NET SDK:
Version: 9.0.202
Commit: 3a53853c30
Workload version: 9.0.200-manifests.5c4e24dc
MSBuild version: 17.13.13+1c2026462
Runtime Environment:
OS Name: Mac OS X
OS Version: 15.3
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/9.0.202/
.NET workloads installed:
[maui-ios]
Installation Source: SDK 9.0.200
Manifest Version: 9.0.14/9.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.maui/9.0.14/WorkloadManifest.json
Install Type: FileBased
[ios]
Installation Source: SDK 9.0.200
Manifest Version: 18.2.9180/9.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.ios/18.2.9180/WorkloadManifest.json
Install Type: FileBased
[maccatalyst]
Installation Source: SDK 9.0.200
Manifest Version: 18.2.9180/9.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.maccatalyst/18.2.9180/WorkloadManifest.json
Install Type: FileBased
[maui]
Installation Source: SDK 9.0.200
Manifest Version: 9.0.14/9.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.maui/9.0.14/WorkloadManifest.json
Install Type: FileBased
Configured to use loose manifests when installing new manifests.
Host:
Version: 9.0.3
Architecture: arm64
Commit: 831d23e561
.NET SDKs installed:
9.0.202 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 9.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 9.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download