Description
openedon Jan 15, 2024
Discussed in #52853
Originally posted by kevon-vems December 16, 2023
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
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode()
.AddInteractiveWebAssemblyRenderMode()
.AddAdditionalAssemblies(typeof(Counter).Assembly);
to
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode()
.AddInteractiveWebAssemblyRenderMode()
.AddAdditionalAssemblies(typeof(MainLayout).Assembly);