I have a big solution with more than 40 projects. Almost half of them are test projects. In my project we use both Code Contracts, Code Analysis, Style Analysis. I want to be able to build the projects that are not dependent in parallel on my quad core CPU.
How can I setup msbuild to build the projects in parallel?
MSBuild can take advantage of systems that have multiple processors, or multiple-core processors. A separate build process is created for each available processor. For example, if the system has four processors, then four build processes are created.
I know that MSBuild can do multithreaded build of projects in a solution.
You can use MSBuild to build multiple projects faster by running them in parallel. To run builds in parallel, you use the following settings on a multi-core or multiple processor computer: The -maxcpucount switch at a command prompt. The BuildInParallel task parameter on an MSBuild task.
Cleaning up specific projects: msbuild MyProjectFile1 /t:Clean msbuild MyProjectFile2 /t:Clean ... This has to be repeated for all projects you need to clean, because MSBuild only accepts single project on command line.
In Visual Studio: Tools | Options | Projects and Solutions | Build and Run. This should default to your CPU count.
From the command line: msbuild /maxcpucount[:n]
(is n is not specified, then it will use the CPU count).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With