-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Description
The wasm-tools workload is required to build a multithreading-enabled WebAssembly app.
By default, people do not have the wasm-tools workload installed. In this scenario, if they create a Blazor WebAssembly app and set <WasmEnableThreads>true</WasmEnableThreads>, then it will fail at runtime as follows:
This doesn't help the developer to understand the problem or how to fix it.
Reproduction Steps
Using an SDK without wasm-tools, create a .NET 9 Blazor WebAssembly Standalone app, set <WasmEnableThreads>true</WasmEnableThreads>, and dotnet run.
Expected behavior
Ideally it would fail at build time with a message like WasmEnableThreads is set to true, but the wasm-tools workload is not installed. To build this project, first run 'dotnet workload install wasm-tools'.
The second best behavior would be failing at runtime with a message like the above.
Actual behavior
Currently it fails saying "Can't find method ... InstallMainSynchronizationContext", giving no clue how to fix it.
Regression?
No
Known Workarounds
n/a
Configuration
.NET 9 + WebAssembly
Other information
No response
