EmbeddedBlazorContent - how to include static content from blazor libraries

If you want to include some static resources from the Blazor component library use “EmbeddedBlazorContent” tool.


Create static content in Blazor component library

Create “content” folder in the root of the library project and add CSS and JS files in.

Add embeded resource build action on all the files

Open properties on each resource file and select “Embedded resource” build action on it.

Additional attributes for embedded resource in the project file

Open .CSPROJ project file and edit EmbeddedResource definition to have additional LogicalName definition.

For CSS files:


For JS files:



Add EmbeddedBlazorContent library to blazor server side web project


Add configuration for embeded content library to Configure metod in Startup.cs

# Startup.cs app.UseEmbeddedBlazorContent(typeof(Bisaga.Core.Components.BsgComponentBase).Assembly);


Add call to EmbeddedBlazorContent where you wish to include embedded files.

@using EmbeddedBlazorContent