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
{{ message }}
Repository navigation
Feature Request: Loading content from EmbeddedResource in the assembly #31
Hi, I've got this somewhat implemented for my purposes, so if you still need it, I could share it or make a PR (seems like I am in the contributing mood lately 😁). There is a single drawback, though. Embedded files must be flattened, meaning that all JS/CSS/images must be in the same directory as index.html. It's fine by me, but it should be somehow possible to configure it to accept any folder structure.
Hi, I've got this somewhat implemented for my purposes, so if you still need it, I could share it or make a PR (seems like I am in the contributing mood lately 😁). There is a single drawback, though. Embedded files must be flattened, meaning that all JS/CSS/images must be in the same directory as index.html. It's fine by me, but it should be somehow possible to configure it to accept any folder structure.
I'm glad you implemented this feature. Would you mind sharing it?
Normally EmbeddedResource uses . for resource names. We can change the value of LogicalName to use /.
It's super similar to the HostedContent class (and could be improved by making an abstract class or merging Hosted and Embedded classes together).
Project file (.csproj) edits:
Replace EmbeddedResource Include with your frontend dist/output folder. The only drawback is that you need to setup your frontend build process to output all files in a single directory, not nested like usual.
I would also like to see this feature!
I think it would fairly easy to swap the current file provider with a CompositeFileProvider as in this microsoft example:
var physicalProvider = _env.ContentRootFileProvider;
var manifestEmbeddedProvider =
new ManifestEmbeddedFileProvider(typeof(Program).Assembly);
var compositeProvider =
new CompositeFileProvider(physicalProvider, manifestEmbeddedProvider);
services.AddSingleton<IFileProvider>(compositeProvider);
Activity
Lemonify commentedon Dec 8, 2023
Hi, I've got this somewhat implemented for my purposes, so if you still need it, I could share it or make a PR (seems like I am in the contributing mood lately 😁). There is a single drawback, though. Embedded files must be flattened, meaning that all JS/CSS/images must be in the same directory as index.html. It's fine by me, but it should be somehow possible to configure it to accept any folder structure.
frg2089 commentedon Dec 9, 2023
I'm glad you implemented this feature. Would you mind sharing it?
Normally
EmbeddedResourceuses.for resource names. We can change the value ofLogicalNameto use/.Lemonify commentedon Dec 9, 2023
It's super similar to the HostedContent class (and could be improved by making an abstract class or merging Hosted and Embedded classes together).
Project file (.csproj) edits:
Replace EmbeddedResource Include with your frontend dist/output folder. The only drawback is that you need to setup your frontend build process to output all files in a single directory, not nested like usual.
Content Provider:
How to use it with Webview:
tbmale commentedon Jun 4, 2026
I would also like to see this feature!
I think it would fairly easy to swap the current file provider with a CompositeFileProvider as in this microsoft example:
@geaz : Does this worth a pull request?