The error message you're seeing is related to the Mono runtime, which is used to run the .NET code in the Blazor WebAssembly application. The error indicates that the Mono runtime is expecting a function called mono_wasm_set_is_debugger_attached
to be exported, but it cannot find it.
This error can occur when the WebAssembly application is being run in a browser that is attempting to attach a debugger, but the function is not actually exported by the application.
To resolve this issue, you can try disabling the WebAssembly debugging feature in your production environment. You can do this by removing the app.UseWebAssemblyDebugging();
line from your code.
Alternatively, you can try setting the ASPNETCORE_ENVIRONMENT
environment variable to "Production" on your production server. This should prevent the app.UseWebAssemblyDebugging()
line from being executed, even if the code is still present in your application.
It's also possible that the issue is related to the specific version of the Mono runtime that is being used by your application. You may want to try updating to the latest version of .NET 6 and/or Mono to see if that resolves the issue.