A free and open-source web framework that enables developers to create web apps using C# and HTML, developed by Microsoft.
Hello @RC ,
With .NET 9, everything works fine using this approach
I get what you're trying to do, but this approach was never officially supported. Blazor WebAssembly is meant to be a full hosting model, not a library.
Also, this change is probably the main reason for the issue: https://learn.microsoft.com/en-us/aspnet/core/migration/90-to-100?view=aspnetcore-10.0#boot-configuration-file-inlined.
blazor.boot.json is no longer used in .NET 10 Blazor WebAssembly apps, which makes it impossible to load Blazor WebAssembly as a library in non-Blazor apps. You could try to reverse-engineer the dotnet.js bootstrapping code to recreate the old behavior, but that would be quite a bit of work and probably not worth it.
If you want to use .NET inside non-Blazor JS apps, you should look into the .NET for WebAssembly browser apps support instead: https://github.com/dotnet/runtime/blob/main/src/mono/wasm/features.md
While this is a non-Microsoft site, it is the official Github repository for the .NET runtime.
and the documentation here https://learn.microsoft.com/en-us/aspnet/core/client-side/dotnet-interop/wasm-browser-app?view=aspnetcore-10.0.
I hope this clarifies.