This project is read-only.

How to Use a Partitioned-Solution Strategy

- J.D. Meier, Jason Taylor, Alex Mackman, Prashant Bansode

If you work on a large system, consider using multiple Visual Studio solutions, each representing a subsystem of your application. These solutions can be used by developers to work on smaller parts of your system without having to load all code across all projects. Design your solution structure so that any projects that have dependencies are grouped together. This enables you to use project references rather than file references. Consider creating a master solution file that contains all of the projects, if you want to use this to build the entire application.

When working with multiple solutions, use a flat file structure for all of your projects. A typical example is an application that has a Microsoft Windows Forms project, an ASP.NET project, a Windows service, and a set of class library projects shared by some or all of those projects.

You can use the following flat structure for all projects:
  1. /Source
  2. /WinFormsProject
  3. /WebProject
  4. /WindowsServiceProject
  5. /ClassLibrary1
  6. /ClassLibrary2
  7. /ClassLibrary3
  8. Web.sln
  9. Service.sln
  10. All.sln

By keeping the structure flat, you gain a lot of flexibility and the ability to use solutions for presenting different views of the projects. Designing the physical folder structure around solution files is very hard to change, especially if you realize that you need to reuse a class library from another solution.

Note: If you are building with Team Build (which relies on MSBuild), it is possible to create solution structures that do not include all referenced projects. As long as the entire solution has been built first, generating the binary output from each solution, MSBuild is able to follow project references outside the boundaries of your solution and build successfully. You cannot build solutions created in this way from the Visual Studio build command, and this approach only works with Team Build and MSBuild.

Additional Resources

  • For more information, see “Chapter 3 – Structuring Projects and Solutions in Source Control” in this guide.

Last edited Jul 26, 2007 at 7:27 AM by prashantbansode, version 1


No comments yet.