var builder = WebApplication.CreateBuilder(args);
// Add MudBlazor services
builder.Services.AddMudServices();
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveWebAssemblyComponents();
var app = builder.Build();
app.UsePathBase("/foo/bar");
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseWebAssemblyDebugging();
}
else
{
app.UseExceptionHandler("/Error", createScopeForErrors: true);
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseStaticFiles(new StaticFileOptions()
{
RequestPath = "/foo/bar",
ServeUnknownFileTypes = true,
});
app.UseAntiforgery();
app.MapRazorComponents()
.AddInteractiveWebAssemblyRenderMode()
.AddAdditionalAssemblies(typeof(MudBlazorWebApp1.Client._Imports).Assembly);
app.Run();
Когда я запускаю это, он работает, когда я нацелен на адрес https: // localhost: 44381/ Но я ожидаю нажать на https: // localhost: 44381/ foo/bar Но когда я это делаю, он не может загружать активы, такие как css и mublazor.min.js и т. Д.
Что я здесь делаю? />
Я создал очень простое приложение Mud Blazor, но по какой -то странной причине базовый путь не уважается. Это моя программа.[code]var builder = WebApplication.CreateBuilder(args);
// Add services to the container. builder.Services.AddRazorComponents() .AddInteractiveWebAssemblyComponents();
var app = builder.Build(); app.UsePathBase("/foo/bar");
// Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseWebAssemblyDebugging(); } else { app.UseExceptionHandler("/Error", createScopeForErrors: true); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); }
app.Run(); [/code] Когда я запускаю это, он работает, когда я нацелен на адрес https: // localhost: 44381/ Но я ожидаю нажать на https: // localhost: 44381/ foo/bar Но когда я это делаю, он не может загружать активы, такие как css и mublazor.min.js и т. Д. Что я здесь делаю? />