Roland Buergi
Roland Buergi

Reputation: 1207

Blazor 9 MapStaticAssets with nuget

I have successfully migrated my Blazor 8 app to Blazor 9. It has a few razor libraries, all of them providing static assets. I have managed to get the project to run successfully using project references and using

app.MapStaticAssets();

Now I am trying to create a setup in which I build nuget packages from the razor libraries. The static assets are put into

contentFiles/any/net9.0/wwwroot

of the nuget package. From what i understand, this should be correct. In the client project, I reference them via

<link href="_content/<package>/standard-page-layout.css" rel="stylesheet" />

which works perfectly when i have project references. However, in the case of nuget packges, this setup does not work. Does anyone know what I am missing? Is the path in the nuget correct? Am I missing some config?

Upvotes: 0

Views: 26

Answers (0)

Related Questions