1

This is a follow-up on the problem reported in this question with this same name.

I am having the same issue in Visual Studio 2022 of objects collapsing after a few seconds or when clicking on another object. The answer provided was changing a setting in CodeMaid, but I have not loaded CodeMaid and am having the same issue.

I have tried multiple variations of checking and unchecking Tools/Options/Projects and Solutions/General options "Track Active Item in Solution Explorer" and "Restore Solution Explorer project hierarchy state on solution load" and nothing works. As I code, I will open Controllers to see the list of methods inside or a data model to view the variables for reference while I am working on other aspects of the code. It is very frustrating to have them close after a few seconds, forcing me to reopen them again, over and over, throughout the day. Any help would be appreciated on this matter.

Timothy G.
  • 6,335
  • 7
  • 30
  • 46
Jeff
  • 35
  • 8

3 Answers3

1

Update:

Version 17.5 appears to have actually resolved this. I tested this out in my IDE and it no longer seems to collapse.


Update: A Microsoft Solution was posted here. They included a fix in Visual Studio version 17.3.5 supposedly. Update your IDE and the issue should hopefully be resolved.


This seems to be a known issue under investigation as reported in the bug tracker for Visual Studio. Using version 17.3.0 Preview 2.0 I too have observed this buggy behavior.

A few other users have mentioned on the same thread they are having the same problem. One user posted steps to reproduce which is similar to what I have tried to reproduce the issue myself:

I expand Blazor project, I expand Pages folder, I lookup and expand a particular .razor file which has a nested .razor.cs file with code, I expand it, see the class node, expand class node, click on a property and usually in this moment, after less than a second or so the branch collapses and the focus in on the razor.cs node.

The ticket says that it "worked-in:Visual Studio 2022 17.0" - perhaps try rolling back to this version if you can. Otherwise, you may have to wait for a fix.

Timothy G.
  • 6,335
  • 7
  • 30
  • 46
0

I had the same problem and I think I found the cause and a solution. The problem is the preview tab, which opens automatically on the right side of the tab area when an element is selected in the solution explorer. I unchecked the Preview Tab option under Options->Environment->Tabs and Windows and haven't had any problems since. greets...

  • I'm sorry, this was not completely correct. I still have problems. But at least I see that the problem is connected to the fact that the corresponding tab/window of the selected item in solution explorer is already open (no problem) or not (problem) – Catrice Aug 17 '22 at 07:30
  • Yes, you are right, it seems to collapse when you change the current selection to another tab/element whether already open or not. It is very annoying when you are going back and forth between varying sections of different elements. It seems that, in an attempt to make VS more intuitive and reactive, they have, inadvertantly, made it more difficult to use. – Jeff Aug 18 '22 at 11:22
0

I'm still having this issue, it restorses the tree view, then collapses it after a few seconds. At least I know it is a long term bug, they have not fixed yet.