Visual Studio 2022: prevent collapsing folders in solution explorer (2)

Viewed 92

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.

2 Answers

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.

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...

Related