10

Every time I open a project in Visual Studio 2022 all folders in the solution explorer tree are collapsing. This is very annoying and interrupts my workflow. I couldn't find any setting for this. Is there a way to prevent this behavior?

This also appears to happen in older versions of Visual Studio.

General Grievance
  • 4,555
  • 31
  • 31
  • 45
arkord
  • 201
  • 1
  • 12
  • 1
    Does this answer your question? [Visual Studio 2022: prevent collapsing folders in solution explorer (2)](https://stackoverflow.com/questions/73023588/visual-studio-2022-prevent-collapsing-folders-in-solution-explorer-2) – Timothy G. Feb 22 '23 at 15:05

1 Answers1

10

As @arkord commented on their own question, the auto-collapse is not coming from VS 2022, but rather from the CodeMaid extension. However they cited the incorrect settings.

  1. In Visual Studio, from the menu bar, select "Extensions" - "CodeMaid" - "Options..."
  2. Then select the "Collapsing" section
  3. Uncheck both the options for:
    • Collapse solutions when they are opened
    • If there is only one project in a solution, keep it expanded but still collapse its children
  4. Select the Save button

Now when opening your solutions in Visual Studio 2022, they should not auto-collapse, instead returning to where you last left off.

General Grievance
  • 4,555
  • 31
  • 31
  • 45
Ross
  • 163
  • 2
  • 9