35

It's annoying to have to separately maintain a .filters file to make Visual Studio happy, as well as my project's on-disk layout. Is it possible to tell VS to use real folders, like it does for C#?

Billy ONeal
  • 104,103
  • 58
  • 317
  • 552

3 Answers3

33

In the Solution Explorer in Visual Studio, just click the toolbar button called 'Show All Files'.

That does exactly what you want.

EDIT(Billy O'Neal): Added image for others so they don't have to hunt... All folders image
(source: billy-oneal.com)

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
C.J.
  • 15,637
  • 9
  • 61
  • 77
  • Dang, I don't like the `Show All Files` options in the slightest for C++, but that's just me. Seems like this setting is per project and gets saved at the solution level. Caused me no end of grief, you have to select the project in Solution Explorer, and notice the little buttons at the top. – Chris O Nov 15 '16 at 02:40
  • 5
    Also this is in no way "does exactly what you want" because it shows "hidden files" or to say it another way "exactly what you want" = Show every file AND DIRECTORY witch is part of the project and ONLY THAT nothing else nothing extra just your actual project – Laz Nikolaj Andersen Dec 03 '17 at 01:49
  • You cannot add classes using context menu in folder view. – Tomáš Zato May 18 '19 at 12:37
3

As an extra tidbit, there is a bug that a few teams and I that were in a class together ran into where disabling the "show all files" option would crash VS10. As of right now there isn't a definite fix, but it seams to be due certain VS specific files being listed when they should not be, or at least that's what the Microsoft Connect said.

As a workaround, please go to Tools - Options - Projects and Solutions - VC++ Project settings and add .vcxproj and .filters to 'Extentions To Hide' there.

Thanks very much to Aly Hirani on Microsoft Connect for help.

zero298
  • 25,467
  • 10
  • 75
  • 100
0

I haven't tried it myself, but are filters only on file extension, or can you match "Dir1/*" with a solution folder?

The other option would be to have a script (preferably a VS extension) update the .filters automatically.

Ben Voigt
  • 277,958
  • 43
  • 419
  • 720