My situation
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 qui
I'm working on 500+ C# application projects. Projects are compiled in parallel and copylocal set to false. Compile time is about 37 min without unit tests and code coverage. 13 min for incremental build without any change in the code.
If I turn off parallel compilation and set copylocal to true, compile time is than 1 h 40 min.
I have different configuration for local build, gated check-in build and server builds with deploy phase (night builds).
Here are my experiences:
/m:2
build should be 2x faster as a /m:1
build. It has nothing to do with dependencies between projects (if copylocal is set to false).Yes, MSBuild uses a timestamp of dependent projects to determine if a project needs a rebuild. It compares input files (code files, referenced assemblies, temporary files,..) timestamp with output assembly. If something is changed, your project is recompiled. Try to reduce the number of dependencies between projects to minimize recompilation. If your change was only in the 'private' part of the project, your output assembly will be changed, assembly timestamp will be changed and all related projects will be rebuild also. You cannot do much with this.
Run your build two times with diagnostic verbosity without any change in your code and check for "Building target "CoreCompile" completely" like I described here. You can have something wrong in your project files and your projects are recompiled every time. If you don't change anything your build log should not contain "Building target "CoreCompile" completely" logs.
Our build server is a virtual machine, not a real piece of hardware. It is not good idea to use a VM for a build server, but it was not my decision.
If you have multi GB RAM try to use part of it as a in-memory hard drive. Your build should be much faster :)
SSD drives are sensitive to high I/O per day. It has an impact on warranty.
I hope it helps someone ... ;)