tryphotino/photino.Blazor

Override IFileProvider for static file assets

Closed this issue · 1 comments

In the moment Photino uses hardcoded PhysicalFileProvider to search for static file assets (´wwwroot´) in AppDomain.CurrentDomain.BaseDirectory.

// ServiceCollectionExtensions.cs
...
.AddSingleton<IFileProvider>(_ =>
{
	var root = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "wwwroot");
	return new PhysicalFileProvider(root);
})

It would be fine if there is a possiblity to override IFileProvider, for example use ManifestEmbeddedFileProvider or create a PhysicalFileProvider which points to a different wwwroot-path:

var embeddedFileProvider = new ManifestEmbeddedFileProvider(Assembly.GetAssembly(type: typeof(Program)), "wwwroot");
var appBuilder = PhotinoBlazorAppBuilder.CreateDefault(embeddedFileProvider, args);

This would allow a more flexibel way to package photino desktop applications.

Merged and completed.