Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[Blazor Wasm] Razor Class libraries static assets are not published in the dist folder #13103
When publishing a Blazor Webassembly App referencing a razor class library the _content folder for the class library is created in the publish/wwwroot/ path instead of publish/ProjectName/dist/ along with all the other app files.
The static assets for a Razor class library should be published in the same folder of the the other assets of a referencng Blazor Webassembly app.
The static assets are published correctly for a Blazor Server app.
From what I can tell, if a referenced Razor Class Library contains the "EmbeddedResource" elements that were present in early versions of the framework, the static assets of these projects will show up in the dist/_content folder. If the project does not contain the EmbeddedResource elements, it will show up in the wwwroot folder, as described by @ghidello.
To work around this, you can make sure the static content is in a folder called
I personally don't know much about how the EmbeddedResource feature works, but it seems the folder name
Seems to be related to removing the feature by which static files are automatically added to the deployed project (#13279). According to what was discussed in that issue, this "workaround" may not continue to work in the future.