Search code examples
visual-studiovisual-studio-2008standards

What is the best location for solution file in Visual Studio?


I prefer for the solution file to be in the same folder as the project files in Visual Studio. I know this is accomplished by unchecking the "Create directory for solution" checkbox. However, VS 2008 defaults to having the box checked.

I am interested in other people's opinions on whether the solution file should live in the same directory.


Solution

  • When a solution contain more than one project, I like a solution file in a parent directory and the project files in its child directories.

    When a solution contains many projects (my current solution has 36 projects/assemblies), then I'll have:

    • Grandparent: solution
    • Child directories: "solution folders" which are logical collections of projects
    • Grandchildren: the projects themselves

    I also agree with having the solution and its project in the same folder, if the solution only has one project. And if you start like this and want to add another project to the solution later, it's easy to change (e.g. create a new solution in a parent directory or move your existing solution, and add/re-add the existing project to it).

    Just don't put several projects in the same folder.