I’ve been experiencing an extremely high build time on a windows mobile project targeted to compact framework 2.0 before finding out what was responsible of such slowness. Fortunately solving this problem is as easy as adding a line to a configuration file.
The project is an order entry application targeted for compact framework 2.0. As of now, it is a solution made up of 7 projects, 2 of which are executables and the other ones are libraries. The first thing I noticed is that slowness occurred on one project only: the data layer. I am using LLBLGen Pro, a powerful O/R mapper that simplifies data layer development taking advantage of its visual designer and code generator. The complete list of assemblies referenced by my project is shown below:
I’m not sure whether the slowness is caused by the LLBLGen Pro or either of the System.Data.* assemblies, or maybe both. I just know that the same issue happened on Windows XP, Vista 64, using either Visual Studio 2005 and 2008. I’ve just reinstalled Vista Ultimate on my T61p yesterday, and at the first full build it took 30 to 60 seconds, whereas it should take just a few seconds. Fortunately I already know how to solve this issue, but I hope anyone having the same issue can find the solution here.
The most important hint came after enabling diagnostic build output (Tools menu, Options, Projects and Solutions, Build and Run, MSBuild project build output verbosity option). After setting this property to Diagnostic, on next build I found the following statistics:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
So it looks like the build spends 18 seconds on the “Platform Verification
Task”. A good explanation about what this task is can be found in this blog
with the solution (although I came to this blog post after I found the
solution elsewhere). In fact I simply need to disable the platform
verification task, by editing the
file in the
C:\Windows\Microsoft.NET\Framework\v3.5 folder. Once the file is
opened using your favorite text editor (mine is Notepad++), locate the
<target> tag having the
name attribute set
1 2 3 4 5 6 7 8 9 10
then add the
Condition attribute to the
PlatformVerificationTask tag as
follows (the added line is the no. 4):
1 2 3 4 5 6 7 8 9 10 11
Last, save and restart Visual Studio. Now the PlatformVerificationTask is not reported in the build log any longer, but most important, a normal build takes less than a second and a rebuild just a couple of seconds.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
Visual Studio For Devices blog: Platform Verification Task