Quick Watch failing irrecoverably after pinning a variable - workaround?

Kamen 45 Reputation points
2023-04-14T23:01:38.42+00:00

Hello, everyone, I have a major software project that consists of 6 solutions with multiple projects within them (to allow efficient cooperative debugging), and tens of thousands of lines of code. There is Windows native code (C++, two of the solutions) and .NET Framework managed code (C#, the other four). The managed code involves some moderate Interop - some shared-memory IPC, access to some system-native API, and so on. It was all created back in the days of VS2005 and now I'm up to the latest VS2022. Since VS2019, I've had this problem where when debugging and using the Quick Watch to inspect my objects, if I tried to pin a variable, I'd permanently lose the ability to see and inspect any but the simplest objects. That is, if I stayed with the new debugger; I'd check the "Use Compatibility Mode" to switch back to the old debugger and things would start working again. As you know, that option was lost with newer versions of VS and even though after installing VS2022 whatever setting was corrupt got cleared and Quick Watch was working normally, I recently accidentally pinned a variable and it all went down. Now I'm stuck and I can't use Quick Watch (nor regular Watches), and I effectively cannot debug my code. I have tried uninstalling and cleaning VS and reinstalling it. I've tried recreating all my project directories and files - to no avail. The problem is 100% reproducible (with my code) but I have not tried to reproduce it with some short, synthetic code for all to see (it'd probably be prohibitively difficult and take me forever, if at all). The only solution would be reinstalling the whole system. I've proven that by setting up VS and my project in a Hyper-V VM and it works... until I pin a variable. I can't work in a VM - my software controls hardware that is not accessible from a native hypervisor. I had created a case with Microsoft (https://developercommunity.visualstudio.com/t/New-style-C-debugger-still-does-not-ope/1438796?ref=native&refTime=1681431454005&refUserId=ea3ea806-6dc2-4ff6-9756-da76a16744f8) previously, while still in VS2019, it was acknowledged as a real problem, but was closed as "low priority". I assume, since it was in an older version of VS, and since there was a workaround. Now it's there in the latest VS, and there is no workaround (that I've been able to identify). I have created a new case now and it was just triaged: https://developercommunity.visualstudio.com/t/C-debugger:-some-objects-in-Quickwatch/10331810?ref=native&refTime=1681430051657&refUserId=ea3ea806-6dc2-4ff6-9756-da76a16744f8 I have little hope it will be fixed in any acceptable timeframe, if at all, so I would like to ask whether any of you have run into such a problem (in which case I'd ask you to upvote the case). But most of all, whether anyone has a suggestion on how to find where this new broken state is recorded (Registry, user profile temp files, etc.), or any other workaround to this problem that would take less time than for me to reinstall Windows. I'd appreciate it very much! Kamen

Developer technologies | Visual Studio | Debugging
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Kamen 45 Reputation points
    2023-04-27T18:10:34.7033333+00:00

    There has been a response from MS to my case and it includes a very easy to implement workaround: just delete the ‘ObjectFavorites.json’ file from within the user documents folder [user]\Documents\Visual Studio [Version]\Visualizers. It has worked for me. Of course, the main issue of being unable to pin a property without losing the ability to view them is still there, and that is still being worked on (I hope!), but I thought I'd mark it as an "answer" to help anyone that may have run into this problem, until an actual solution is implemented. I will update this post when (if) one is provided.

    Kamen

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.