Reputation: 7887
In Visual Studio, how do you change the order of your source files?
By default, it seems that they go in alphabetical order but I want to put them in a more logical order.
Upvotes: 16
Views: 6498
Reputation: 1484
The usual solution would be to prefix the filenames with numbers. This is at least useful for folders, e.g. 00_comes_first
, 01_externals
, 01_tools
, 99_last_of_the_important_folders
would appear near the top before any files starting with letters.
Unfortunately, Microsoft broke this in recent releases of Visual Studio (17.6 and up) and now the numbered directories appear last unlike in every other piece of software (including the git changes view in VS). Feel free to upvote the corresponding bug report https://developercommunity.visualstudio.com/t/Ordering-in-Solution-Explorer-changed-n/10371646
Upvotes: 0
Reputation: 141638
You can't change the order that the Solution Explorer displays your files. If you need a more logical grouping, consider using folders and namespaces.
Upvotes: 14