Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Decrease Visual Studio build time [closed]

I've got a Visual Studio solution that consists of about 100 projects. Most of them form a dependency hierarchy. Now if I change a single .cs for a project and build it, all dependent projects get built as well - regardless of whether they've been changed or not. Is there a way to make Visual Studio only build the changed projects? I'm wasting minutes every time I do a little change by rebuilding the whole lot. It adds up big time!

like image 295
EasierSaidThanDone Avatar asked Sep 05 '12 20:09

EasierSaidThanDone


People also ask

Why is Visual Studio build so slow?

One of the reasons, is Visual Studio keeps rebuilding the same dependent project(s) over and over although nothing has changed. Imagine a Solution having tons of Projects that keep being built for no apparent reason. This wastes HUGE time...


2 Answers

No, there is no good way to do this. Some incremental building does sometimes occur (Visual Studio 2010 or later), but there are no guarantees.

Compile the projects that are mature into assemblies, and reference them from your unstable (currently in development) projects. If you are doing proper unit testing, this should not be a huge issue. Divide and conquer; finish the dependencies first and get them stable, then commit them to assemblies.

like image 66
Robert Harvey Avatar answered Sep 22 '22 20:09

Robert Harvey


Reduce the number of projects.

Each project produces a DLL - a unit of deployment. This is normally not needed.

If you need to arrange your code logically, you can use folders within a project.

Also, instead of project references, reference the DLLs built.


Why this suggestion works:

  • Less DLLs are produced.
  • There are less references to these DLLs, so less DLLs need to be copied around.
  • Projects that are referenced by many other projects get recompiled for each referencing project. If a DLL is used instead of a project reference, a recompilation will not occur.
like image 26
Oded Avatar answered Sep 21 '22 20:09

Oded