Skip to content

Can't debug over a JS interop module call in .NET 10 rc2 in VS2026: [MONO] * Assertion: should not be reached at /__w/1/s/src/runtime/src/mono/mono/metadata/class-accessors.c:93 #120883

Closed

Description

@monkeyK1n9

Description

When loading a Javascript module in my Blazor wasm standalone app, and debugging, when passing over the line that imports the module, debugging is interrupted but not stopped entirely and I get this error:

[MONO] * Assertion: should not be reached at /__w/1/s/src/runtime/src/mono/mono/metadata/class-accessors.c:93

Error
    at Mc (http://localhost:5238/_framework/dotnet.runtime.fn94ls2wwa.js:3:172298)
    at dotnet.native.wasm.wasm_trace_logger (http://localhost:5238/_framework/dotnet.native.nc30dazgys.wasm:wasm-function[16401]:0x38357a)
    at dotnet.native.wasm.eglib_log_adapter (http://localhost:5238/_framework/dotnet.native.nc30dazgys.wasm:wasm-function[3456]:0x10fb77)
    at dotnet.native.wasm.monoeg_g_logv_nofree (http://localhost:5238/_framework/dotnet.native.nc30dazgys.wasm:wasm-function[3357]:0x10d5cf)
    at dotnet.native.wasm.monoeg_assertion_message (http://localhost:5238/_framework/dotnet.native.nc30dazgys.wasm:wasm-function[3361]:0x10d775)
    at dotnet.native.wasm.mono_assertion_message_unreachable (http://localhost:5238/_framework/dotnet.native.nc30dazgys.wasm:wasm-function[3364]:0x10d816)
    at dotnet.native.wasm.mono_class_get_flags (http://localhost:5238/_framework/dotnet.native.nc30dazgys.wasm:wasm-function[4496]:0x14ee5e)
    at dotnet.native.wasm.mono_class_setup_fields (http://localhost:5238/_framework/dotnet.native.nc30dazgys.wasm:wasm-function[4438]:0x147173)
    at dotnet.native.wasm.init_sizes_with_info (http://localhost:5238/_framework/dotnet.native.nc30dazgys.wasm:wasm-function[4442]:0x149366)
    at dotnet.native.wasm.mono_class_init_internal (http://localhost:5238/_framework/dotnet.native.nc30dazgys.wasm:wasm-function[4439]:0x1479b3)
program exited (with status: 1), but keepRuntimeAlive() is set (counter=4) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)
MONO_WASM: Assert failed: .NET runtime already exited with 1 [MONO] * Assertion: should not be reached at /__w/1/s/src/runtime/src/mono/mono/metadata/class-accessors.c:93

>Note: If I remove the breakpoint before the JS interop (using IJSRuntime), and put it after the module import, no error is thrown and the import is successful. Image

Reproduction Steps

  • Create a blazor wasm standalone app
  • Add a script to the wwwroot folder, say "js/theme.js"
  • Add the script to the index.html file as a module
<script type="module" src="js/theme.js"></script>
// theme.js

// determine if the default system theme is dark
export const isSystemThemeDark = () => {
    return window.matchMedia('(prefers-color-scheme: dark)').matches ?? false;
}
  • Import the module in C# in VS 2026 insiders and put a breakpoint before the assignment to the module accessor
protected override async Task OnAfterRenderAsync(bool firstRender)
{
    if (firstRender)
    {
        if (_themeAccessorJsRef is null)
        {
            _themeAccessorJsRef = await jsRuntime.InvokeAsync<IJSObjectReference>("import", "./js/theme.js");
        }
    }

    await base.OnAfterRenderAsync(firstRender);
}
  • Run the app in debug mode default http profile

Expected behavior

The module should be assigned correctly and the breakpoint should work without issues

Actual behavior

The debugging with the breakpoint (that arrow of debugging) disappears. The debugging process does not stop and the app displays itself in the browser

Regression?

No response

Known Workarounds

Place the breakpoint after your JS interop calls

Configuration

I am on:
.NET 10 rc2
VS 2026 insiders
Chrome browser

Other information

No response

Activity

  1. added
    untriaged
    on Oct 19, 2025
  2. added
    needs-area-label
    on Oct 19, 2025
  3. added and removed
    needs-area-label
    on Oct 19, 2025
  4. dotnet-policy-service commented on Oct 19, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @thaystg, @dotnet/dotnet-diag
    See info in area-owners.md if you want to be subscribed.

  5. maraf commented on Dec 18, 2025

    @maraf
    Member

    There were several issue in .NET RC2 and Blazor WebAssembly. Can you please try again with the GA and report back if you still experience issues?

  6. added
    arch-wasm
    needs-author-action
    os-browser
    and removed
    untriaged
    on Dec 18, 2025
  7. added this to the Future milestone on Dec 18, 2025
  8. dotnet-policy-service commented on Dec 18, 2025

    @dotnet-policy-service
    Contributor

    This issue has been marked needs-author-action and may be missing some important information.

  9. dotnet-policy-service commented on Dec 18, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
    See info in area-owners.md if you want to be subscribed.

  10. dotnet-policy-service commented on Jan 1, 2026

    @dotnet-policy-service
    Contributor

    This issue has been automatically marked no-recent-activity because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will remove no-recent-activity.

  11. dotnet-policy-service commented on Jan 16, 2026

    @dotnet-policy-service
    Contributor

    This issue will now be closed since it had been marked no-recent-activity but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.

  12. removed this from the Future milestone on Jan 16, 2026
  13. locked and limited conversation to collaborators on Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-wasmarea-Debugger-mononeeds-author-actionos-browser

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions