title: How to decrease MSBuild times
body: <p><strong>My situation</strong></p>
  
  <p>In the C# project I am now working on we have a fairly big solution (80+ projects). Now rebuild times of 5 minutes+ are really becoming quite a problem using MSBuild from <a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Visual_Studio_2008" rel="noreferrer">Visual&nbsp;Studio&nbsp;2008</a>.</p>
  
  <p>In an analysis I did last week it turned out that my build time was spent as follows:</p>
  
  <ol>
  <li><p>Copying files to the projects and recopying it to the projects that depend on it (CopyToLocal), etc. (60%)</p></li>
  <li><p>Invoking a postbuild to decompile/compile. (20%)</p></li>
  <li><p>Doing the actual compilation, etc. (20%)</p></li>
  </ol>
  
  <p>Apart from the 'normal' project <code>bin\debug</code> folders output is also copied to an external directory to set up the main 'loader' program. The main program structure is a bit like this:</p>
  
  <pre><code>\loader\bin\loader.exe
  
  \loader\plugin\plugin1\plugin1.dll
  
  \loader\plugin\plugin1\somedependency.dll
  </code></pre>
  
  <p><strong>What I did</strong></p>
  
  <p>In an attempt to make things go a little faster I thought of the following:</p>
  
  <ol>
  <li><p>Copy all the files to one a big bin directory and don't use <strong>CopyTolocal</strong>. I don't like this because we can no longer use different versions of the same DLL files and my bin directory is getting quite a mess.</p></li>
  <li><p><a href="http://www.hanselman.com/blog/FasterBuildsWithMSBuildUsingParallelBuildsAndMulticoreCPUs.aspx" rel="noreferrer">Use parallelism (/m) for MSBuild</a>. This helps only very little in build times.</p></li>
  <li><p>Try to reduce dependencies between projects which is always a good thing of course.</p></li>
  <li><p>Invest in hardware. I found some <a href="http://www.joelonsoftware.com/items/2009/03/27.html" rel="noreferrer">research on solid-state drives</a>, but this does not seem promising.</p></li>
  </ol>
  
  <p><strong>My question</strong></p>
  
  <p>I also noticed that when I make a change to a project that is at the root of my dependency tree everything gets rebuild. Even if the change was only in the 'private' part and the interface of the project did not change.</p>
  
  <p>Does MSBuild use a timestamp of dependent projects to determine if a project needs a rebuild?</p>
  
  <p>Can this be changed to a different condition? For example, the checksum of the file?</p>
  
  <p>Apart from this specific suggestion I would sure appreciate all suggestions to make build times faster.</p>