Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project Order in Visual Studio Solution

In Visual Studio 2008, what determines the order in which projects appear within a solution folder? It's not alphabetical order, nor is it build order.

I cannot find any way of altering the order in which projects are being listed. I've tried removing my .suo file, as well as moving things about in the .sln file. Neither had any effect.

How can I change the order in which my projects are being displayed?

like image 794
Kent Boogaart Avatar asked Feb 11 '10 13:02

Kent Boogaart


People also ask

How do I change the order of projects in Visual Studio?

One of them is: Press F2 to rename a project, then press Enter without changing the name. This temporarily sorts the projects within that folder.

How do I change the project build order in Visual Studio 2019?

In order to set the Build order for your Solution, right-click on the Solution in Solution Explorer and Select Project Build Order: Your Project Dependencies should be set correctly which is used to determine the Build order by Visual Studio.

What is project and solution in Visual Studio?

A project is contained within a solution. Despite its name, a solution is not an "answer". It's simply a container for one or more related projects, along with build information, Visual Studio window settings, and any miscellaneous files that aren't associated with a particular project.


2 Answers

Unfortunately VS2010 forces projects to be alphabetically sorted.

Perhaps renaming the projects by adding a numerical prefix (01, 02, 03, etc) to achieve the desired order is the only workaround, although not ideal either.

like image 91
Sam Avatar answered Sep 26 '22 02:09

Sam


There is a feedback Request already placed at Connect.Microsoft.com so, you will have to wait for the permanent solution.

http://connect.microsoft.com/VisualStudio/feedback/details/468874/solution-explorer-project-sort-order (replaced with Wayback Machine link as original was removed)

Temporary workarounds are available but not good enough I feel. One of them is:

Press F2 to rename a project, then press Enter without changing the name. This temporarily sorts the projects within that folder.

(As per http://social.msdn.microsoft.com/Forums/en-US/vssetup/thread/79d46a69-386e-4ad8-b9cb-b00d4252495b/?prof=required )

Or use http://solutionsorter.codeplex.com/ to alter SLN for permanent fix if your solution folders are not nested (it ate my solution)

But this will not work if you close and open the solution.

If you use Resharper, you can press the short cut CTRL + N to find out files in solution and CTRL + F12 to find out methods in the file.

like image 25
Jeeva Subburaj Avatar answered Sep 25 '22 02:09

Jeeva Subburaj