Creating a Custom Blazor WebAssembly Project Template
Learn how to create a custom Blazor WebAssembly template.
We'll cover the following
As we have seen, the Demo
Blazor WebAssembly project created by the Blazor WebAssembly App project template includes quite a few files. In later chapters, we will want to start with an empty Blazor project. So, we will create our own project template that creates an empty Blazor WebAssembly project.
Creating an empty Blazor project
We need to create an empty Blazor WebAssembly project to base our new project template on. We do this as follows:
- Return to Visual Studio.
- Delete the
wwwroot\sample-data
folder. - Delete all of the components in the
Pages
folder, except for theIndex
component. - Open the
Index.razor
file. - Delete all of the markup from the
Index
component. Make sure that you do not delete the@page
directive at the top of the page. - Delete the
Shared\SurveyPrompt.razor
file. - Open the
Shared\MainLayout.razor
file. - Remove the “About” link from the top row of the layout by removing the following markup:
Get hands-on with 1400+ tech skills courses.