4

Is there a way to collapse all the files at once in the Solution Explorer window in Visual Studio?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
FiveTools
  • 5,970
  • 15
  • 62
  • 84

6 Answers6

5

Use the extension Collapse Solution. Usually, this feature comes with ReSharper, but I presume that you are not using ReSharper.

There are also a lot of macros out there that help you do the same. One of them is in ‘Collapse All’ in Visual Studio.

Note: There is no inbuilt way in Visual Studio to actually achieve this. And considering just how practical it is, I would have thought they would have added this kind of feature way back in Visual Studio 2005 itself. I know people have been asking for it for years. But in their infinite wisdom, Microsoft don't consider it important enough.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Jagmag
  • 10,283
  • 1
  • 34
  • 58
  • 1
    Resharper should just be built into VS by default :) – Phill Nov 25 '10 at 03:43
  • 1
    they considered it by making extensibility easy in VS 2010. Ms cannot do 'everything that every developer want' in single product. If you need something - check is there extension for that. If no extension - get your favorite tool and build it yourself. – Alexey Shcherbak Nov 25 '10 at 04:06
  • They do have an inbuilt way now. There is an icon in solution explorer in visual studio 2013 that gives you the capability. Check out my answer below. – Jay Jay Jay Apr 20 '15 at 17:50
4

In visual studio 2013, there is a button in solution explorer - Collapse All enter image description here

Jay Jay Jay
  • 1,970
  • 2
  • 25
  • 47
  • This is standard in VS 2013, but unfortunately it was not in VS 2010. Really annoying, but I guess it does show progress in the newer versions. – DJ van Wyk Sep 01 '15 at 07:22
2

I think this extension have requested functionality - PowerCommands for VS 2010. Also Productivity Power Tools contains solution navigator which also have this feature and much more usefull stuff for solution navigation and search.

Edited: there also a lot of examples of macro, doing this stuff.

Alexey Shcherbak
  • 3,394
  • 2
  • 27
  • 44
1

In Visual Studio 2013 you can do it with right click by Solution -> Collapse All

Pavel Yermalovich
  • 1,970
  • 1
  • 15
  • 19
1

Try free VSCommands 2010 Lite extension. It has this and few other free features.

Registered User
  • 1,630
  • 14
  • 11
0

Of course, you can collapse any selected node by pressing '-', but I understand you are probably looking to collapse the entire tree.

Flipster
  • 4,373
  • 4
  • 28
  • 36