Creating a Razor Class Library
Explore how to create and test Razor class libraries in Blazor to build reusable components for multiple projects. This lesson guides you through creating a Razor class library project, adding it as a reference, and verifying component functionality within a Blazor application.
We'll cover the following...
We'll cover the following...
We can share components across projects by using a Razor class library. To create a Razor class library, we will use the Razor Class Library project template. We do this as follows:
- Right-click the solution and select the “Add, New Project” option from the menu.
- Enter “Razor Class Library” in the “Search for templates” textbox to locate the Razor Class Library project template:
- Select the “Razor Class Library” project template.