Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practices for large solutions in Visual Studio (2008) [closed]

We have a solution with around 100+ projects, most of them C#. Naturally, it takes a long time to both open and build, so I am looking for best practices for such beasts. Along the lines of questions I am hoping to get answers to, are:

  • how do you best handle references between projects
    • should "copy local" be on or off?
  • should every project build to its own folder, or should they all build to the same output folder(they are all part of the same application)

  • Are solutions' folders a good way of organizing stuff?

I know that splitting the solution up into multiple smaller solutions is an option, but that comes with its own set of refactoring and building headaches, so perhaps we can save that for a separate thread :-)

like image 292
Eyvind Avatar asked Mar 27 '09 14:03

Eyvind


People also ask

Can a Visual Studio project have multiple solutions?

You can have multiple projects in one instance of Visual Studio. The point of a VS solution is to bring together all the projects you want to work with in one place, so you can't have multiple solutions in one instance. You'd have to open each solution separately.

How many projects can Visual Studio handle?

Some authors propose a number between 15-20 maximum projects in a Visual Studio Solution to be a good compromise. I disagree; my proposal is one for production code and a separate project for tests. Adding any other project to a solution should be considered very carefully.

What is the difference between 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.


1 Answers

You might be interested in these two MSBuild articles that I have written.

MSBuild: Best Practices For Creating Reliable Builds, Part 1

MSBuild: Best Practices For Creating Reliable Builds, Part 2

Specificially in Part 2 there is a section Building large source trees that you might want to take a look at.

To briefly answer your questions here though:

  • CopyLocal? For sure turn this off
  • Build to one or many output folders? Build to one output folder
  • Solution folders? This is a matter of taste.

Sayed Ibrahim Hashimi

My Book: Inside the Microsoft Build Engine : Using MSBuild and Team Foundation Build

like image 107
Sayed Ibrahim Hashimi Avatar answered Nov 06 '22 03:11

Sayed Ibrahim Hashimi