Skip to content

UseWebAssemblyDebugging causes strange log messages #35292

@SteveSandersonMS

Description

@SteveSandersonMS

If you run the Blazor WebAssembly "hosted" project, and manually add the following lines to work around https://github.com/aspnet/AspNetCore-ManualTests/issues/814#issuecomment-897673794:

if (app.Environment.IsDevelopment())
{
    app.UseWebAssemblyDebugging();
}

... and then run with F5 inside VS 2022 Preview 4, the log output looks like this:

info: Microsoft.Hosting.Lifetime[14]
      Now listening on: https://localhost:7278
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5278
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: C:\path\to\app\Server
Hosting environment: Production
Content root path: C:\path\to\app\Server
Now listening on: http://127.0.0.1:55048
Application started. Press Ctrl+C to shut down.

This is really confusing because it says the hosting environment is Development and Production, and that we're listening on 3 different ports.

I think what's happening is that the debug proxy is logging its own "app startup" message, but this is bad because it's confusing - I really thought it was running in Production mode for a while, and went down a wrong path with some debugging. We should stop it from logging this wrong info.

Metadata

Metadata

Labels

area-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions