When I try to run a .NET WebAssembly Browser App with multithreading enabled, the runtime doesn't start because the required COOP and COEP headers are not set for the worker script:
'
Repro steps:
- Install the .NET 9 SDK
- Install the wasm-experimental workload:
dotnet workload install wasm-experimental
- Create a new .NET WebAssembly Browser App:
dotnet new wasmbrowser -o WasmBrowserApp
- Run the app and load in the browser:
dotnet run - ✅ the stopwatch counter runs fine
- Update WasmBrowserApp.csproj to enable multithreading:
<WasmEnableThreads>true</WasmEnableThreads>
- Run the app again and reload in the browser - ❌ the stopwatch counter never starts, as if the runtime didn't load
There are no errors in the browser console, but if you check the browser issues tab you should see the following security error:

To work around the issue you can publish the app and then serve it using dotnet serve with the correct headers: dotnet serve -h "Cross-Origin-Opener-Policy:same-origin" -h "Cross-Origin-Embedder-Policy:require-corp" --directory .\bin\Release\net9.0\publish\wwwroot