Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project created by dotnet new blazor -int WebAssembly -ai cannot be deployed to a static web site #55658

Closed
1 task done
leungkimming opened this issue May 10, 2024 · 3 comments
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question Status: Resolved

Comments

@leungkimming
Copy link

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

  1. dotnet new blazor -int WebAssembly -ai
  2. Open in VS and publish to a folder
  3. 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

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label May 10, 2024
@leungkimming leungkimming changed the title Project created by dotnet new blazor -int WebAssembly -ai cannot deploy to a static web app Project created by dotnet new blazor -int WebAssembly -ai cannot be deployed to a static web site May 10, 2024
@javiercn
Copy link
Member

@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.

@javiercn javiercn added question ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. labels May 11, 2024
@leungkimming
Copy link
Author

I shall be most grateful if you can give us back the "dotnet blazorwasm --hosted" template in .net 8. I have developed a MAUI container App with SSO MASL authentication and uses a Web View to load many blazorwasm Apps from a static site without authentication (MASL token authentication is not supported when loading from Web View). The MAUI container will pass the MASL token to the balzor App when calling API.

Copy link
Contributor

This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.

See our Issue Management Policies for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question Status: Resolved
Projects
None yet
Development

No branches or pull requests

2 participants