Example errors, this errors for all the files:
Failed to load resource: the server responded with a status of 404 ()
icons.min.css
Failed to load resource: the server responded with a
status of 404 () jquery.min.js < /p>
< /blockquote>
program.cs
Код: Выделить всё
var builder = WebApplication.CreateBuilder(args);
//Tried this and its not working
builder.WebHost.UseWebRoot("wwwroot");
builder.WebHost.UseStaticWebAssets();
// Add services to the container.
builder.Services.AddRazorComponents()
.AddServerComponents()
.AddWebAssemblyComponents();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseWebAssemblyDebugging();
}
else
{
app.UseExceptionHandler("/Error");
// 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(); //this does not work too
app.MapRazorComponents()
.AddServerRenderMode()
.AddWebAssemblyRenderMode();
app.Run();
< /code>
app.razor:
Подробнее здесь: https://stackoverflow.com/questions/771 ... ing-404-er