Skip to content

Fix WASM restore failing with runtime pack missing#2994

Merged
adamsitnik merged 1 commit intodotnet:masterfrom
ilonatommy:fix-runtime-pack-missing-wasm
Feb 9, 2026
Merged

Fix WASM restore failing with runtime pack missing#2994
adamsitnik merged 1 commit intodotnet:masterfrom
ilonatommy:fix-runtime-pack-missing-wasm

Conversation

@ilonatommy
Copy link
Member

@ilonatommy ilonatommy commented Feb 9, 2026

This should fix perf tests failures in runtime, e.g dotnet/runtime#124134.

When running WASM benchmarks, the build fails with error NETSDK1112:
"The runtime pack for Microsoft.NETCore.App.Runtime.browser-wasm was not downloaded."

BenchmarkDotNet runs:

# restore that works for portable packages only
dotnet restore

# build without restore, when the project has `<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>`, build fails because the runtime pack was not downloaded
dotnet build --no-restore

Runtime restore must be explicitly specified on the command line.
This change adds -r browser-wasm to the restore command when the runtime is WasmRuntime.

log

[2026/02/08 01:19:45][INFO] // start /datadisks/disk1/work/B6C309DE/p/dotnet/dotnet  build "/datadisks/disk1/work/B6C309DE/w/C16D0A77/e/performance/artifacts/bin/for-running/MicroBenchmarks/MicroBenchmarks-Wasm-1/BenchmarkDotNet.Autogenerated.csproj" -f net11.0 -c Release --no-restore --nodeReuse:false /p:UseSharedCompilation=false /p:Deterministic=true /p:Optimize=true /p:NuGetPackageRoot="/datadisks/disk1/work/B6C309DE/w/C16D0A77/e/performance/artifacts/packages" -bl:MicroBenchmarks-Wasm-1-build-no-restore.binlog /p:ArtifactsPath="/datadisks/disk1/work/B6C309DE/w/C16D0A77/e/performance/artifacts/bin/for-running/MicroBenchmarks/MicroBenchmarks-Wasm-1/" /p:OutDir="/datadisks/disk1/work/B6C309DE/w/C16D0A77/e/performance/artifacts/bin/for-running/MicroBenchmarks/MicroBenchmarks-Wasm-1/bin/Release/net11.0/browser-wasm/" /p:OutputPath="/datadisks/disk1/work/B6C309DE/w/C16D0A77/e/performance/artifacts/bin/for-running/MicroBenchmarks/MicroBenchmarks-Wasm-1/bin/Release/net11.0/browser-wasm/" /p:PublishDir="/datadisks/disk1/work/B6C309DE/w/C16D0A77/e/performance/artifacts/bin/for-running/MicroBenchmarks/MicroBenchmarks-Wasm-1/publish/" --output "/datadisks/disk1/work/B6C309DE/w/C16D0A77/e/performance/artifacts/bin/for-running/MicroBenchmarks/MicroBenchmarks-Wasm-1/bin/Release/net11.0/browser-wasm/" in /datadisks/disk1/work/B6C309DE/w/C16D0A77/e/performance/artifacts/bin/for-running/MicroBenchmarks/MicroBenchmarks-Wasm-1
[2026/02/08 01:19:46][INFO] /datadisks/disk1/work/B6C309DE/p/dotnet/sdk/11.0.100-preview.1.26069.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(546,5): error NETSDK1112: The runtime pack for Microsoft.NETCore.App.Runtime.browser-wasm was not downloaded. Try running a NuGet restore with the RuntimeIdentifier 'browser-wasm'. [/datadisks/disk1/work/B6C309DE/w/C16D0A77/e/performance/artifacts/bin/for-running/MicroBenchmarks/MicroBenchmarks-Wasm-1/BenchmarkDotNet.Autogenerated.csproj::TargetFramework=net11.0]
[2026/02/08 01:19:46][INFO] Build FAILED.
[2026/02/08 01:19:46][INFO] /datadisks/disk1/work/B6C309DE/p/dotnet/sdk/11.0.100-preview.1.26069.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(546,5): error NETSDK1112: The runtime pack for Microsoft.NETCore.App.Runtime.browser-wasm was not downloaded. Try running a NuGet restore with the RuntimeIdentifier 'browser-wasm'. [/datadisks/disk1/work/B6C309DE/w/C16D0A77/e/performance/artifacts/bin/for-running/MicroBenchmarks/MicroBenchmarks-Wasm-1/BenchmarkDotNet.Autogenerated.csproj::TargetFramework=net11.0]

Copy link
Member

@radekdoulik radekdoulik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, :shipit:

@adamsitnik adamsitnik merged commit 0f0d553 into dotnet:master Feb 9, 2026
11 checks passed
@timcassell timcassell added this to the v0.16.0 milestone Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants