You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With client side hosting model, the resource path is _content/<AssemblyName>/<RecursivePath>. But when using this library to fix the server side hosting, the path becomes EmbeddedBlazorFile/<RecursivePath>.
If the component library only contains js and css files it would work properly (maybe not if there are some files with the same recursive path in different libraries) because the js and css is loaded with the _Host.cshtml that can use @Html.EmbeddedBlazorContent() to reference the js and css files with the same default path.
But what if something like an image file is referenced within a blazor component? What would be the proper path for making it work for both client side and server side hosting?
Btw, what does the default path EmbeddedBlazorFile/<RecursivePath> stand for rather than using _content/<AssemblyName>/<RecursivePath> that client side hosting uses?
The text was updated successfully, but these errors were encountered:
For me, I copied the favicon.ico file into the content\dist folder of my library. The file is available to the browser at EmbeddedBlazorFile/dist/favicon.ico.
It's quite simple to get the whole wwwroot folder automatically in a server-side project:
Adjust your _Host.cshtml file in the server project or create it if it doesn't exist, copy the index.html content from your client side project to it and add the following at the top:
In your server project startup class, add using EmbeddedBlazorContent; to the usings section and the following code to the Configure method in your server project startup class:
With client side hosting model, the resource path is
_content/<AssemblyName>/<RecursivePath>
. But when using this library to fix the server side hosting, the path becomesEmbeddedBlazorFile/<RecursivePath>
.If the component library only contains js and css files it would work properly (maybe not if there are some files with the same recursive path in different libraries) because the js and css is loaded with the _Host.cshtml that can use
@Html.EmbeddedBlazorContent()
to reference the js and css files with the same default path.But what if something like an image file is referenced within a blazor component? What would be the proper path for making it work for both client side and server side hosting?
Btw, what does the default path
EmbeddedBlazorFile/<RecursivePath>
stand for rather than using_content/<AssemblyName>/<RecursivePath>
that client side hosting uses?The text was updated successfully, but these errors were encountered: