Thursday, April 23, 2009

Speed up your Compact Frameworks Builds

One features that is built in to the CompactFrameworks build process is an evaluation of your code to make sure that all of the “stuff” you use within the .NET frameworks is indeed available to the Compact Frameworks.  While this sounds like and a good idea, and it probably is, it does come with a cost.  The project I’m working on is not too small at ~35K NCLOC but by default it was taking a minimum of 75 seconds to do a full re-build.  After casually watching Debug View while building I was noticing a lot of calls to “Platform Validation Task”.  In fact most of the time it was building, it was spitting out these debug messages.  So with that bit of knowledge it was fairly easy to figure out the next steps on how to make this more efficient.

 

1) Find the target file for Compact Frameworks: [MS_BUILD_DIR]\Microsoft.CompactFramework.Common.Targets

2) Find the section that runs the PlatformVerificationTask and add a condition as shown below, you could just comment out this section, but running this for releases is probably a good idea.

 

image

 

Once I made this change, my build time went from 75+ seconds down to less than 5.

Hope this helps you out.

-ec

No comments:

Post a Comment