aspnetcore: Blazor server doesn't render pages properly with custom WebApplicationOptions

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

If I use the following code snippet in Program.cs:

    var builder = WebApplication.CreateBuilder(new WebApplicationOptions
    {
        ApplicationName = typeof(Program).Assembly.FullName,
        ContentRootPath = Path.GetFullPath(Directory.GetCurrentDirectory()),
        WebRootPath = "wwwroot",
        Args = args
    });

Blazor server doesn’t show the web page properly.

Expected Behavior

Blazor server renders the pages properly with custom WebApplicationOptions.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

6.0.9, 6.0.109

Anything else?

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (12 by maintainers)

Most upvoted comments

@khteh It’s not obvious to us what is going on here (hence why we marked the issue as investigate).

We will schedule the issue to be looked at in a future milestone based on our triage (To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.) and will provide an update at that point.

A repro project would help to make sure that we can reproduce your exact issue and determine if there is a bug in the framework or a configuration error in the application.