microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
228 stars 12 forks source link

[BUG] iOS MAUI App Locks up when debugging on MacOS VSCode #1526

Open tpitman opened 2 weeks ago

tpitman commented 2 weeks ago

Describe the Issue

When I debug my iOS MAUI app on MacOS using VSCode and the MAUI plugin it just locks up at random times.

Sometimes it will just be running fine and then stops responding. I don't get any exceptions or errors of any kind. It just stops working at all and I have to force close it.

This always happens right after hitting a breakpoint and then hitting RUN to continue debugging.

Again there are not exceptions or errors of any kind. I even opened the Mac console and attached to the phone and didn't see anything there either that would indicate anything.

This has been happening since version 8.0.20 since I have been using VSCode. I never had this issue with Visual Studio 2022 for Mac.

Steps To Reproduce

  1. Debug my app
  2. Hit a breakpoint
  3. Hit run
  4. Notice the app doesn't respond anymore

Expected Behavior

Not lock up

Environment Information

| VS Bug 2241733

tpitman commented 1 week ago

I just have to add a comment that I wish the VSCode experience was at least as good as VS for Mac.

I am trying to debug my app and now I have to delete my app and debug. Then it will work about 1/3 times. The other 2 times it starts debugging and then just says that the process has ended.

I then have to remove the app and it will debug 1/3 times.

Also just after removing the app and debugging this way a message appears asking if I want to allow this app to discover network devices. I always allow.

Sometimes ones it works I can debug until I disconnect the iPhone to head home from the office. Then I have to do the whole song and dance again the next time I get back to work until it works and then might work for a while.

I keep a lot of data in preferences, so having to remove the app causes me to start all over in setting things up to get back to the point to debug what I am working on. It is a real pain.

For all of this I went back to VS for Mac because I can't put up with all this hassle and need to get this bug figure out I am working on.

VS for Mac just works. It always debugs and I never have to remove my app to get back to debugging. I know I won't be able to use VS for Mac for many more days, so I just don't know what to do.

VS for Windows in a VM isn't any better. In fact everything about that is slower and more of a hassle.

Why can't the VSCode debugging work just like VS for Mac?

mlancione commented 1 week ago

I am also experiencing the same issues. Debugging a .NET iOS app (non-Maui) with VS Code on MacOS 14.7 w/ .NET 9 RC 2 using the iOS Simulator or an iOS device.

kimho1021 commented 1 week ago

After the discontinuation of Visual Studio for Mac, I attempted to switch to Visual Studio Code, but unlike Visual Studio for Mac, I frequently encounter the issue of the screen freezing when setting debug.assert or breakpoints in VS Code, which is quite frustrating. This problem occurs more often when Sentry is enabled, and it seems that I need to disable Sentry to run MAUI iOS projects smoothly in VS Code.

mlancione commented 1 week ago

Here are some outputs I see when the debugger issues occur.

When using “Step Over”:

Received a single step request while the previous one was still active.
Step request failed: This request is not supported by the protocol version implemented by the debuggee.

When using “Jump To Cursor”: Error setting next statement. Previous set next statement request is still in progress.

When using “Set Value” in Watch when on a breakpoint then hitting Run: Error setting next statement. Previous set next statement request is still in progress.