-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single File Publish - Embed MudBlazor's .\wwwroot\_content directory #147
Labels
Comments
So I've done some more digging and tried doing the exact same thing as was done in #106 I've ended up using the 2 repository approach to embed all the necessary resources in my assembly's Resources\ directory, along with the Manifest.xml file. Here's my manifest file: <?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Manifest>
<ManifestVersion>1.0</ManifestVersion>
<FileSystem>
<File Name="
					LinguisticStimulationPlanner.wwwroot._content.MudBlazor.MudBlazor.min.css
				">
<ResourcePath>
LinguisticStimulationPlanner.wwwroot._content.MudBlazor.MudBlazor.min.css
</ResourcePath>
</File>
<File Name="
					LinguisticStimulationPlanner.wwwroot._content.MudBlazor.MudBlazor.min.js
				">
<ResourcePath>
LinguisticStimulationPlanner.wwwroot._content.MudBlazor.MudBlazor.min.js
</ResourcePath>
</File>
<File Name="
					LinguisticStimulationPlanner.wwwroot.index.html
				">
<ResourcePath>
LinguisticStimulationPlanner.wwwroot.index.html
</ResourcePath>
</File>
<File Name="
					LinguisticStimulationPlanner.wwwroot.linguistic-stimulation-planner.png
				">
<ResourcePath>
LinguisticStimulationPlanner.wwwroot.linguistic-stimulation-planner.png
</ResourcePath>
</File>
<File Name="Microsoft.Extensions.FileProviders.Embedded.Manifest.xml">
<ResourcePath>Microsoft.Extensions.FileProviders.Embedded.Manifest.xml</ResourcePath>
</File>
</FileSystem>
</Manifest> However, whenever I pass "wwwroot" to the Here's my Program.cs: using LinguisticStimulationPlanner.Data;
using LinguisticStimulationPlanner.Services;
using LinguisticStimulationPlanner.Utilities;
using LinguisticStimulationPlanner.Components;
using Microsoft.EntityFrameworkCore;
using MudBlazor.Services;
using Photino.Blazor;
using Microsoft.Extensions.FileProviders;
using System;
using Microsoft.Extensions.DependencyInjection;
namespace LinguisticStimulationPlanner
{
public class Program
{
[STAThread]
public static void Main(string[] args)
{
PhotinoBlazorAppBuilder appBuilder = PhotinoBlazorAppBuilder.CreateDefault(args);
ConfigureServices(appBuilder.Services);
DatabaseSetup.SetupDatabase();
appBuilder.RootComponents.Add<App>("app");
PhotinoBlazorApp app = appBuilder.Build();
app.MainWindow
.SetSize(1400, 800)
.SetLogVerbosity(0)
.SetDevToolsEnabled(true)
//.SetIconFile("favicon.ico")
.SetTitle("Linguistic Stimulation Planner");
AppDomain.CurrentDomain.UnhandledException += (sender, error) =>
{
app.MainWindow.ShowMessage("Fatal exception", error.ExceptionObject.ToString());
};
app.Run();
}
private static void ConfigureServices(IServiceCollection services)
{
string databasePath = DatabaseSetup.GetDatabasePath();
services.AddLogging();
services.AddSingleton<IFileProvider>(_ => new ManifestEmbeddedFileProvider(typeof(Program).Assembly, "wwwroot"));
services.AddMudServices();
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlite($"Data Source={databasePath}"));
services.AddScoped<GoalService>();
services.AddScoped<LocationService>();
services.AddScoped<PatientService>();
services.AddScoped<ToyService>();
}
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi all,
Project Dependencies
What I Tried
[ x ] I read the PublishPhotino README
[ x ] The fix recommended in this #94
[ x ] The fix recommended in this #106
ManifestEmbeddedFileProvider Invalid path: "wwwroot"
Even if my resources are correctly embedded I still get an error thrown by the embedded file provider saying that "wwwroot" is an invalid path:
Thanks
Here's my
.csproj
file for reference:The text was updated successfully, but these errors were encountered: