0

I'm currently working on a Blazor WebAssembly (WASM) .NET5 application and facing a challenge with client-side debugging: I'm looking to enable runtime code changes and move the execution pointer, similar to what's possible when debugging server-side. My development environment is Visual Studio 2022, and I'm using Mono/C# for the client-side part.

So far, I've noticed that these advanced debugging features don't seem to be directly available for client-side debugging. While server-side debugging works smoothly, allowing me to make changes that are automatically applied and to move the execution pointer, I can't find comparable options for client-side debugging.

Are there specific settings, extensions, or tools I need to enable to facilitate this kind of advanced debugging for Blazor WASM on the client side? Are particular versions of .NET or Mono required to support such debugging features?

Any tips or guidance on how to enable these debugging capabilities would be greatly appreciated. Thank you in advance!

I have made several attempts to improve client-side debugging for my Blazor WASM application in Visual Studio 2022:

Researching Documentation and Online Resources: I scoured Microsoft's official documentation and various online forums for any hints on advanced debugging features that enable runtime code changes and moving the execution pointer on the client side.

Tweaking VS2022 Settings: I adjusted different settings within Visual Studio 2022, hoping to uncover hidden or undocumented options for enhanced debugging.

Checking for Updates: I ensured that my .NET and Mono versions were up to date to rule out any compatibility issues.

My expectation was to find a way to make the client-side debugging experience as robust as the server-side. Specifically, I was hoping for:

Runtime Code Changes: The ability to modify code at runtime and see those changes reflected immediately in the running application without needing to restart the debugging session.

Moving the Execution Pointer: The capability to freely move the execution pointer to manually test different execution paths without having to rerun the entire code.

Despite my efforts, I was unable to activate or find such functionality, leading to an inefficient debugging experience, particularly when it comes to testing and refining the client side.

2 Answers 2

0

If you continue on .NET 5, I think what you expected is unachievable.

Take a look of this:

Hot Load Support for .NET applications

enter image description here

I think you need .NET6 at least.

Sign up to request clarification or add additional context in comments.

Comments

0

Update:

I’ve upgraded my Blazor WebAssembly project to .NET 8, hoping that the newer version would resolve the issue with client-side debugging. Unfortunately, the problem still persists. Even after the upgrade, I am unable to enable runtime code changes or move the execution pointer during client-side debugging in Visual Studio 2022.

I was expecting the more advanced debugging capabilities in .NET 8 to improve the experience, but the client-side debugging limitations remain the same. Any further suggestions or insights would be greatly appreciated.

Output Hot Reload:

14:00 14.60 WarehouseServer.Server (Webserver): Hot Reload session started

14:00 16.99 WarehouseServer.Server (Webassembly): Hot Reload session started

14:02 03.34 WarehouseServer.Server (Webassembly): Sending updates to the running application

14:02 03.38 WarehouseServer.Server (Webassembly): [Error] Failed to apply updates to the application. Error in the request sent to the browser: No websocket connection. Error in the request sent to the browser: No websocket connection

14:02 03.40 Unexpected error. All pending updates have been discarded.

2 Comments

Output Hot Reload: 14:00 14.60 WarehouseServer.Server (Webserver): Hot Reload session started 14:00 16.99 WarehouseServer.Server (Webassembly): Hot Reload session started 14:02 03.34 WarehouseServer.Server (Webassembly): Sending updates to the running application 14:02 03.38 WarehouseServer.Server (Webassembly): [Error] Failed to apply updates to the application. Error in the request sent to the browser: No websocket connection. Error in the request sent to the browser: No websocket connection 14:02 03.40 Unexpected error. All pending updates have been discarded.
If you need to add additional information to your question then you should edit your original question. Please only use the "Post Answer" button if you have found an answer to your question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.