DEV Community

loading...

Discussion on: How to deal with the "HTTP 404 '_content/Foo/Bar.css' not found" when using Razor component package on ASP.NET Core Blazor app

Collapse
waziplay profile image
wazi

Hi
Great and detailed post.
I have one question - how do the entries appear in the StaticWebAssets.xml file in the first place.

<ContentRoot ...

I have a folder with a sub folder that contains my wwwroot and a .js file in it.

The entry is not appearing

Collapse
waziplay profile image
wazi

I fixed my own problem by understanding how the static files are "copied".
In my case I had to copy the static files into wwwroot (top level folder of the project). Right click (each file) > properties and set the Build Action to Content.
When the NuGet package is created these files should then be in the staticwebassets folder.
You can check this locally (win 10) C:\Users{username}.nuget\packages\unitedgroup.blazor\1.0.1\staticwebassets
When you reference the package in your consuming code it will serve up the content as usual - just make sure you have the path right (all explained in the original post above)

If I've added to the confusion - apologies.
If it helps in your situation - cool.