Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
I Have a Blazor Server .NET 8 App. In my local environment using the name "Development" the application runs correctly. However, after hosting the application on an IIS server side, all the content references at wwwroot are returning 404 like CSS, images, and javascript files. It can't find any resources (wwroot) even though the folder does exist on the server. As additional information, the application is hosted by https://www.contoso.com/{MYAPP} and I have configured the App base path described in the documentation at App Base Path. Everything works in the dev environment, but no int the server.
Some code examples in the program file
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
builder.WebHost.UseWebRoot("wwwroot");
builder.WebHost.UseStaticWebAssets();
......
WebApplication app = builder.Build();
app.UseStaticFiles("/App/Treatment");
app.UsePathBase("/App/Treatment");
....
app.UseHttpsRedirection();
app.UseRouting();
app.UseCors();
app.UseAntiforgery();
app.UseCookiePolicy();
app.UseAuthentication();
app.UseAuthorization();
app.UseSession();
app.UseResponseCaching();
app.MapDefaultControllerRoute();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
app.Run();
App.razor
<base href="/App/Treatment/" />
Expected Behavior
No response
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
8.0.100