dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.91k stars 4.63k forks source link

DEBUGGING IS NOT ENABLED when trying to debug .NET 8 Blazor Web project simulating iOS device on edge #104234

Closed mip1983 closed 4 weeks ago

mip1983 commented 2 months ago

Description

When debugging my blazor applciation (.NET 8, blazor web project using wasm, running on Aspire) in Edge, if I hit f12 and choose any iOS device to simulate and refresh, I see this error in the console and the application crashes:

image

Reproduction Steps

  1. Create a .NET Aspire project and aa Blazor web application within it.
  2. Start debugging the application and hit f12 to open the dev tools for edge
  3. Change to an iOS device and refresh.

Expected behavior

The app should load/debug without erroring

Actual behavior

Error in description

Regression?

I assume this has worked in the past and I can see similar issue's logged previously e.g.

https://github.com/dotnet/runtime/issues/84171

Known Workarounds

No response

Configuration

.NET 8.0.302 Edge

Other information

No response

maraf commented 1 month ago

We are using navigator.userAgentData.brands and navigator.userAgent values to determine if current browser is one of the supported for debugging. The predefined profiles for simulations overrides these values to better similate target platform. This means we can't evaluate if the browser is supported for debugging or note.

A way to by pass this is to create a custom profile based on values for any iOS device, but leave user agent value unchanged.

@thaystg What would happen if we omit the check for supported browsers and "turn on" debugging in any browser (eg. safari)? I understand the debugging won't work, but is the check for supported browsers only optimization to not load pdbs on unsupported browsers or would the runtime crash or something otherwise?

thaystg commented 1 month ago

I think the correct fix here would be not send the runtime_ready in debug.ts if the debugger is not enabled?