unoplatform / Uno.Wasm.Bootstrap

A simple nuget package to run C# code in a WASM-compatible browser
Other
367 stars 57 forks source link

VS breakpoints don't work with WasmShellEnableThreads #803

Open SerratedSharp opened 10 months ago

SerratedSharp commented 10 months ago

In the attached, setting WasmShellEnableThreads to false, breakpoints in VS2022 work. Setting to true, breakpoints do not work. Using .NET 8 RC2 and preview version of VS2022, Version 17.8.0 Preview 6.0 (https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-notes-preview#1780-pre60--visual-studio-2022-version-178-preview-6)

If this is expected behavior, I would like to propose updating the debugger support documentation to help users avoid this pitfall. Please confirm if you'd consider a PR for the documentation.

https://github.com/unoplatform/Uno.Wasm.Bootstrap/blob/main/doc/debugger-support.md

image

Wasm8Test.Wasm.zip

SerratedSharp commented 10 months ago

Another pitfall perhaps worth noting in documention, is if you use the Project Properties dialog, it can add these sections elsewhere in the project, and the DebugType=full will overwrite DebugType=portable and prevent breakpoints. Often I like to have a Troubleshooting section at the bottom of documentation so that these items can be mentioned to help others, but not interupt/detract from the main flow of the documentation.


  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <DebugType>full</DebugType>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <DebugType>full</DebugType>
  </PropertyGroup>
``
jeromelaban commented 10 months ago

This is a feature that may be missing in the runtime debugger, which we only bundle from the original source. That being said, since Blazor does not support threading, it's likely that there will be additional challenges.

SerratedSharp commented 10 months ago

This is a feature that may be missing in the runtime debugger, which we only bundle from the original source. That being said, since Blazor does not support threading, it's likely that there will be additional challenges.

If we don't anticipate it being fixed(and or it's out of our control), is it worth mentioning in documentation? I think there's alot of ways debugging can be broken. And without expert knowledge, trying to isolate all the right combination of settings by brute force and get them all aligned to make debugging work can be very time consuming.