Project created by dotnet new blazor -int WebAssembly -ai cannot be deployed to a static web site
leungkimming opened this issue · comments
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
In .net 7, I can create 2 projects with dotnet blazorwasm --hosted and deploy the Client project to a static web site. My usage is to load this Client project into a MAUI WebView and the Client will call a specifc API server to do business.
In .net 8, I created 2 projects with dotnet new blazor -int WebAssembly -ai but there is no way to deploy the Client to a static web site to be loaded into MAUI WebView.
Expected Behavior
Same as previous blazorwasm --hosted, project created with dotnet new blazor -int WebAssembly -ai should be able to deploy to static web site.
Steps To Reproduce
- dotnet new blazor -int WebAssembly -ai
- Open in VS and publish to a folder
- Copy the folder to a static web site
Exceptions (if any)
The static web site failed to load
.NET Version
.net 8
Anything else?
No response
@leungkimming thanks for contacting us.
You need to create a standalone web assembly project and add a reference to it to an asp.net core server project. The default Blazor Web template with webassembly interactivity is configured to render the root document from a razor component and is not suitable for deploying into a static site.