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

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.


I prefer it something like this:

MyProject
  src
    Domain
    Application
    Infrastructure
    UI
  solutions
    MyProject
    Infrastructure
    Domain

Solutions folder contains solution folders. All projects are referenced from src folder.