Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Descripción:
When creating a new Blazor project targeting .NET 9, the generated App.razor file contains the entire HTML document structure (, , , , etc.) instead of only Blazor components like , , and .
Expected Behavior
Expected behavior:
According to Blazor best practices and documentation, the HTML structure should be in wwwroot/index.html (for Blazor WebAssembly) or in _Layout.cshtml (for Blazor Server).
App.razor should only contain Blazor components, for example:
Actual behavior:
The template generates App.razor like this:
Impact:
• and do not work as expected.
• The project does not follow the recommended Blazor structure.
• This can confuse developers and break dynamic head updates.
Steps to reproduce:
- Create a new Blazor project targeting .NET 9.
- Open the generated App.razor file.
- Observe that it contains the full HTML structure.
Environment:
• .NET 9
• Visual Studio 2022 (or specify your IDE)
• Blazor (WebAssembly or Server, specify which)
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
No response
Anything else?
No response