Ross Borchers
Ross Borchers

Reputation: 145

How to specify project filter order in visual studio?

Since the purpose of filters is to show the logical layout of a project where is this feature?

For some reason any top level filters always get stuck between my "Header Files" and "Source Files" Filters. Its not even in alphabetical order.

Note that I'm not interested in ordering my projects but rather the filters within my projects.

So how can I specify the order of my filters or at least sort them alphabetically?

Upvotes: 6

Views: 2178

Answers (2)

George
George

Reputation: 1

Move the filter folder you want sorted to any other folder. Then move it back to the root folder you want it within. When dropped there it will be sorted alphabetically.

Upvotes: 0

Tomas Tintera
Tomas Tintera

Reputation: 839

In Visual Studio 2012 new filter is added in alphabetical order of it's default name. But later renames have no effect. Not very convenient, but we can get desired result:

Workaround one:

  1. Before adding folder: add "a" to every folder name you want above to be above the new one. Add "zz_" to every folder you want to be bellow the new new one.

  2. Add your new folder.

  3. Rename all your folders back.

It's tedious but still better than nothing.

Workaround two: If you want to add multiple new folders, just add them in a row and rename later, so they are in desired order.

Workaround three: Edit the project's XML directly might work too. But I personally prefer to not touch such a magic file.

Upvotes: 5

Related Questions