runtime: After .NET 6 upgrade, debugger crashes when redirecting from one blazor wasm app to another

Describe the bug

On Blazor WASM projects targeting .NET 6, if you run the project in debug mode, the Visual Studio debugger crashes if you attempt to redirect to another Blazor WASM application that also targets .NET 6. The broswer immediately closes.

Here is a quick example I’ve made on the counter page using the default VS template for a standalone Blazor WASM project:

@page "/counter"
@inject NavigationManager NavigationManager

<PageTitle>Counter</PageTitle>

<h1>Counter</h1>

<p role="status">Current count: @currentCount</p>

<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>

@code {
    private int currentCount = 0;

    private void IncrementCount()
    {
        NavigationManager.NavigateTo("https://bgriffy.github.io/BlazorWasmDebugRepro/");
        currentCount++;
    }
}

If you run this in debug mode, the debugger will immediately crash once you hit the counter button. The application its redirecting to was also created using the default VS template for a standalone Blazor WASM app targeting .NET 6. (https://github.com/bgriffy/BlazorWasmDebugRepro)

I’ve found that if either of the projects target .NET 5 instead, the debugger runs without issue.

To Reproduce

  • Ensure .NET 6 SDK is installed.
  • Either create a standalone .NET 6 blazor WASM app, using the default template in VS, and paste the code above in the counter page. Or you can clone my repo: https://github.com/bgriffy/BlazorWasmDebugRepro2
  • Run the project in debug mode and click the button on the counter page.

Exceptions

This is the only exception I’ve seen which I think is related. It pops up in the immediate window in VS.

* Assertion at /__w/1/s/src/mono/mono/eglib/gptrarray.c:117, condition `<disabled>' not met

Further technical details

  • ASP.NET Core version: 6.0.100
  • I’m using Visual Studio Professional 2022, 17.1.0 Preview 1.1. But I’ve also reproduced the issue on the current release version.
  • Include the output of dotnet --info:
dotnet --info Output
dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.100
 Commit:    9e8b04bbff

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19041
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.100\

Host (useful for support):
  Version: 6.0.0
  Commit:  4822e3c3aa

.NET SDKs installed:
  2.1.700 [C:\Program Files\dotnet\sdk]
  5.0.101 [C:\Program Files\dotnet\sdk]
  5.0.401 [C:\Program Files\dotnet\sdk]
  5.0.402 [C:\Program Files\dotnet\sdk]
  6.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (10 by maintainers)

Most upvoted comments

The published app(https://bgriffy.github.io/BlazorWasmDebugRepro/) is still using dotnet 6.0.0, right? image

Right you are! After publishing both projects with the .NET 6.0.2 SDK, I no longer have any issues debugging. I’ll go ahead and close the issue now. Thanks for the help on this!

Did this fix make it to the 7 preview 1 release ?

This is on release 6.0.2.

The published page that you are trying to redirect https://bgriffy.github.io/BlazorWasmDebugRepro is in release mode? If you publish in debug mode it works correctly?

Thanks, Thays

Hey @thaystg, thanks for responding. FYI, I published the app (https://bgriffy.github.io/BlazorWasmDebugRepro) in debug mode but it looks like I’m having the same problem.