Blazor WASM projects will not run

Viewed 25

Creating a new Blazor WASM project will not run using dotnet run or Visual Studio non-debug mode. It will run in Visual Studio debug. Blazor server works properly. I do my development using VS debug mode, so I have no idea how long this has been broken.

The browser tools shows an exception while running WebAssemblyHostBuilder.CreateDefault(args); in Program.cs

Exception: System.TypeInitializationException: The type initializer for 'System.UriParser' threw an exception.

Any ideas? I am really stuck on this!

Thanks

I have tried reinstalling .NET sdks, Visual Studio, but am unable to fix this.

1 Answers

Well, don't I feel like an idiot. I spent all this time trying to fix the development environment, and in a last act of desperation, I tried a repair on the Edge browser...and that fixed it.

Sometimes it is better to be lucky than good...

Related