Modify the Blazor Web App template #52853
-
The default template for Blazor Web App contains boilerplate code, samples for Counter and Weather. We all know and love these. However, they're the first thing to go when using this template as a starting point for creating a real website. The template uses the Counter to load additional assemblies. If you remove the Counter, it is not intuitive that you need to replace Counter with something else, and further not intuitive what that might be. If you alter the template to use the MainLayout instead, it would make removing the counter more straight forward, and generally make it so you would never need to change the AddAdditionalAssemblies(typeof(THING).Assembly) ever again. If someone could point me at where the template lives, I'd happily create the PR myself. Change
to
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I believe we already changed the Blazor Web App template to no longer use the Counter component for setting up the client as an additional assembly: https://github.com/dotnet/aspnetcore/blob/main/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Program.cs#L122. Also, there is now an option on the Blazor Web App template for choosing whether you want the sample pages. If you unselect that option, then you get an empty template. |
Beta Was this translation helpful? Give feedback.
I believe we already changed the Blazor Web App template to no longer use the Counter component for setting up the client as an additional assembly: https://github.com/dotnet/aspnetcore/blob/main/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Program.cs#L122.
Also, there is now an option on the Blazor Web App template for choosing whether you want the sample pages. If you unselect that option, then you get an empty template.