`dotnet watch run` times out at the _ResolveWasmOutputs step for a WASM project that targets net9.0
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
### Describe the bug
After installing 18.8.x of Visual Studio 2026 and consequently getting the 10.0.3xx band of .NET SDK, I can no longer use `dotnet watch run` on my project that targets net9.0.
The console output gets to the _ResolveWasmOutputs step and just hangs there for about 5 minutes, at which time these errors are shown:
```
BlazorWasmStandaloneNet9 net9.0 browser-wasm failed with 2 error(s) (300.7s)
C:\Users\bzook\.nuget\packages\microsoft.net.sdk.webassembly.pack\10.0.10\build\Microsoft.NET.Sdk.WebAssembly.Browser.targets(260,5): error MSB4216: Could not run the "ComputeWasmBuildAssets" task because MSBuild could not create or connect to a task host with runtime "NET" and architecture "x64". Please ensure that (1) the requested runtime and/or architecture are available on the machine, and (2) that the required executable "C:\Program Files\dotnet\sdk\10.0.302\MSBuild.exe" exists and can be run.
C:\Users\bzook\.nuget\packages\microsoft.net.sdk.webassembly.pack\10.0.10\build\Microsoft.NET.Sdk.WebAssembly.Browser.targets(278,7): error MSB4027: The "ComputeWasmBuildAssets" task generated invalid items from the "AssetCandidates" output parameter. This object is no longer valid because the MetadataLoadContext that created it has been disposed.
```
I've attached a sample sample to use to demonstrate the issue.
### Steps to reproduce
Unzip the attached project and run `dotnet watch run` on it.
[BlazorWasmStandaloneNet9.zip](https://github.com/user-attachments/files/30801006/BlazorWasmStandaloneNet9.zip)
### Expected behavior
The project to build and launch with hot reload enabled.
### Actual behavior
Fails to launch.
### Is this a regression?
Yes, the 10.0.200 band of .NET SDK doesn't have this problem.
### Are there any workarounds?
Use `global.json` to force dotnet to use an SDK older than 10.0.3xx.
### dotnet --info output
```console
.NET SDK:
Version: 10.0.302
Commit: 35b593bebf
Workload version: 10.0.302.1
MSBuild version: 18.6.11+35b593beb
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.302\
.NET workloads installed:
[wasm-tools]
Installation Source: SDK 10.0.300
Manifest Version: 10.0.110/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.workload.mono.toolchain.current\10.0.110\WorkloadManifest.json
Install Type: FileBased
Configured to use workload sets when installing new manifests.
Host:
Version: 10.0.10
Architecture: x64
Commit: f7d90799ce
.NET SDKs installed:
9.0.316 [C:\Program Files\dotnet\sdk]
10.0.302 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.29 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
DOTNET_CLI_UI_LANGUAGE [en-US]
DOTNET_GCHeapCount [2]
DOTNET_GCNoAffinitize [1]
DOTNET_MULTILEVEL_LOOKUP [0]
DOTNET_STARTUP_HOOKS []
DOTNET_TC_CallCountThreshold [1000]
DOTNET_ThreadPool_UnfairSemaphoreSpinLimit [0]
DOTNET_gcConcurrent [0]
Detected COMPlus_* environment variable(s). Consider transitioning to DOTNET_* equivalent.
global.json file:
Not found
```
### IDE version
Visual Studio 18.8.2
### Other details
_No response_
Contributor guide
No contributing guide indexed for this repository
Research direction
Unzip the attached BlazorWasmStandaloneNet9 sample and run `dotnet watch run` with the 10.0.302 SDK to reproduce the timeout at `_ResolveWasmOutputs`. Start with `Microsoft.NET.Sdk.WebAssembly.Browser.targets` around lines 260 and 278, then compare against the 10.0.200 behavior. Done means the net9.0 WASM project launches with hot reload on the newer SDK without the task-host errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100