Building a solution with many projects is SLOWWWWWWW
This week I am attending TechEd in Orlando FL and I was honored to be requested to work the C# booth by the MVP and C# teams. I got many great questions from attendees and I thought I would post some of the more interesting ones. So here goes.
An attendee, let’s call him Bob, came up and said that his builds were very slow. After some chatting Bob told me that he has a huge number of projects in his solution all “joined” together using project references. This is a convent feature of Visual Studio that provides for “cascading” builds. By that I mean if you change some code in a business library when VS does the build it will build that library first, copy the dll into any projects that reference it, then build those projects. This is very convent but as Bob noted when he changes one line of code in a method it causes the entire project to rebuild. This is not a big deal if the project is small and the builds are quick but if the project is large this could be a very painful experience. So we tossed around some things I would classify as workarounds like for example writing some post build steps that would move dll’s around and the like. But in my opinion the best solution is a properly architected solution. To that end I pointed Bob to an article put together by the P&P group at Microsoft that provides guidance for the architecture of large application with many projects and how to break them up into manageable chunks.
Structuring Projects and Solutions
http://www.codeplex.com/VSTSGuidance/Wiki/View.aspx?title=Chapter%203%20-%20Structuring%20Projects%20and%20Solutions%20in%20Source%20Control