Is there a way to collapse all the files at once in the Solution Explorer window in Visual Studio?
6 Answers
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.

- 30,738
- 21
- 105
- 131

- 10,283
- 1
- 34
- 58
-
1Resharper should just be built into VS by default :) – Phill Nov 25 '10 at 03:43
-
1they 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
In visual studio 2013, there is a button in solution explorer - Collapse All

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

- 3,394
- 2
- 27
- 44
In Visual Studio 2013 you can do it with right click by Solution -> Collapse All

- 1,970
- 1
- 15
- 19
Try free VSCommands 2010 Lite extension. It has this and few other free features.

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

- 4,373
- 4
- 28
- 36