In this module, you faced and resolved a problem with building, packaging, and sharing Blazor components that can be used and reused across Blazor applications.

You learned how to build a Razor class library that contains components to be shared with many applications. To assemble the library, you:

  • Created a new Razor class library from the .NET template.
  • Added a .razor file with a Blazor component and a .razor.css file that contains its style sheet.
  • Added package metadata to the project file, which defines the package for other developers.
  • Created a NuGet package from your Razor class library by using the .NET command-line interface.

Blazor components are the building blocks that make it easier for you to build more complex applications. By building components and pages that reference other components, you can more quickly deliver applications that take advantage of the user-interface paradigms that other developers have shared with you. When you can depend on reusing earlier investments made by other developers, you can save time and money on your own projects as well.


For more information, see Consume ASP.NET Core Razor components from Razor class libraries.