none
Compact Framework Build takes long time

    Question

  •  

    I have a VS 2008 compact framework project targeting Windows Mobile 5.0 that takes a long time to build. I ran a build with full verbosity and here are the the times.

     

    Task Performance Summary:

    0 ms Delete 1 calls

    0 ms CreateProperty 1 calls

    0 ms AssignTargetPath 5 calls

    0 ms ConvertToAbsolutePath 1 calls

    1 ms RemoveDuplicates 2 calls

    1 ms FindUnderPath 5 calls

    1 ms AssignCulture 1 calls

    1 ms FindAppConfigFile 1 calls

    1 ms GetFrameworkPath 1 calls

    1 ms MakeDir 1 calls

    1 ms Message 3 calls

    1 ms GetDeviceFrameworkPath 1 calls

    2 ms ReadLinesFromFile 1 calls

    2 ms CreateCSharpManifestResourceName 1 calls

    10 ms ResolveAssemblyReference 1 calls

    13 ms GenerateResource 1 calls

    84 ms AddHighDPIResource 1 calls

    112 ms Copy 6 calls

    295 ms Csc 1 calls

    433809 ms PlatformVerificationTask 1 calls

     

    Don't know if this is the best area to post this but why is this platform verification task taking so long? This seems to be the only info in the build output:

     

    Target "PlatformVerificationTask" in file "C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.CompactFramework.Common.targets":

    Task "PlatformVerificationTask"

    Done executing task "PlatformVerificationTask".

    Done building target "PlatformVerificationTask" in project "SkillManager.csproj".

     

    Maybe I can disable this task? Any Ideas?

     

     

     

    Tuesday, February 26, 2008 6:40 PM

Answers

  • Okay,

     

    I found a couple of posts on this problem. The first is here:

     

    http://blogs.msdn.com/vsdteam/archive/2006/09/15/756400.aspx

     

    The second is here:

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2474337&SiteID=1

     

    Since I 'seem' to be building for .NET 3.5, I went to the Microsoft.CompactFramework.Common.Targets file in the v3.5 framework folder and edited to hopefully disable the task (by the way, I'm using Vista, am an administrator and had to grant permissions for the file to me as a user to get it to save which I found somewhat bizarre). I added the Condition element but it did not work:

     

        <Target
            Name="PlatformVerificationTask" Condition="'$(SkipPlatformVerification)' != 'true'">
            <PlatformVerificationTask
                PlatformFamilyName="$(PlatformFamilyName)"
                PlatformID="$(PlatformID)"
                SourceAssembly="@(IntermediateAssembly)"
                ReferencePath="@(ReferencePath)"
                TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
                PlatformVersion="$(TargetFrameworkVersion)"/>
        </Target>

     

    Looks like I have to set an environment variable somewhere. Where do I do that? A search of MSDN using "environment variable" and then filtering to VS 2008 returns no results.

     

    By the way, after closing Visual Studio and reopening it, I built my project. Each time I build it, the PlatformVerificationTask takes longer and longer.

     

    1st time: 47 sec.

    2nd: 1.14 sec.

    3rd: 1.36 sec.

    4th, 1.57 sec.

     

    I would say you have a problem here.

     

     

    Tuesday, February 26, 2008 9:03 PM

All replies

  • Okay,

     

    I found a couple of posts on this problem. The first is here:

     

    http://blogs.msdn.com/vsdteam/archive/2006/09/15/756400.aspx

     

    The second is here:

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2474337&SiteID=1

     

    Since I 'seem' to be building for .NET 3.5, I went to the Microsoft.CompactFramework.Common.Targets file in the v3.5 framework folder and edited to hopefully disable the task (by the way, I'm using Vista, am an administrator and had to grant permissions for the file to me as a user to get it to save which I found somewhat bizarre). I added the Condition element but it did not work:

     

        <Target
            Name="PlatformVerificationTask" Condition="'$(SkipPlatformVerification)' != 'true'">
            <PlatformVerificationTask
                PlatformFamilyName="$(PlatformFamilyName)"
                PlatformID="$(PlatformID)"
                SourceAssembly="@(IntermediateAssembly)"
                ReferencePath="@(ReferencePath)"
                TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
                PlatformVersion="$(TargetFrameworkVersion)"/>
        </Target>

     

    Looks like I have to set an environment variable somewhere. Where do I do that? A search of MSDN using "environment variable" and then filtering to VS 2008 returns no results.

     

    By the way, after closing Visual Studio and reopening it, I built my project. Each time I build it, the PlatformVerificationTask takes longer and longer.

     

    1st time: 47 sec.

    2nd: 1.14 sec.

    3rd: 1.36 sec.

    4th, 1.57 sec.

     

    I would say you have a problem here.

     

     

    Tuesday, February 26, 2008 9:03 PM
  • Nevermind on the environment variable. Duh, it's a windows environment variable. Now that it is turned off, things are moving quickly.

     

    It would be really nice if you could turn this check off for debug builds and just have it execute on release builds though. That would seem to make sense to me, at least until it is fixed.

     

    Tuesday, February 26, 2008 9:16 PM
  • Thank you very much!  Building Compact Framework programs has been slow for me for a long time now, and now that I have disabled the PlatformVerificationTask, they compile WAY faster.  I have searched for reasons for the slow build times before, but was never able to figure out any way to make it faster.  I wish I had found this out years ago!  I am sure my productivity will be better too.  Recently on VS 2008 I had a problem where Compact Framework programs would randomly switch back and forth between their normal slow build times, and extremely long build times.  It even seemed that when the builds started taking a very long time, they would keep taking longer and longer every time I would build.  So I agree with you this seems like a bug.  Microsoft really needs to both fix this bug and optimize the PlatformVerificationTask.  Now that I know how to enable and disable the PlatformVerificationTask with an environment variable it is not much of an issue for anymore though, so thanks again for this post.
    • Edited by INTPnerd Friday, May 30, 2008 5:19 AM actually the author did mention a bug but they called it a &quot;problem&quot;
    Friday, May 30, 2008 5:11 AM
  • I know this is a really old post, but I am running into the same issue. I edited the Microsoft.CompactFramework.Common.Targets and added  Condition="'$(SkipPlatformVerification)' != 'true'" to the platform verification task and have had no luck. In your earlier post you mention that it did NOT work for your either, but then in this next post, you say nevermind about an environmental variable and that you turned it off and it is "moving quickly". But you never explained what you did. I knoe its old, but can you please help me out and detail what you did AFTER you added the line to Microsoft.CompactFramework.Common.Target that made it finally work? 

    Thanks a ton, I really appreciate it.
    Wednesday, December 2, 2009 6:57 PM
  • I started experiencing this problem suddenly about 4 days ago.  Now my Builds take 30 minutes.  Have you been able to determine how to reduce the time?
    Dick
    Thursday, December 17, 2009 2:42 AM
  • I've been experiencing the same problem using VS2008 & CF3.5, but coming across this solved it. Just set the line in the targets file as above, then set the environment variable. The variable you need to set is:

    Variable Name: SkipPlatformVerification
    Value: "true"

    or set the value back to "false" to re-enable it.


    • Proposed as answer by ieatskunk Friday, February 5, 2010 10:42 PM
    Thursday, January 14, 2010 8:15 AM
  • This work around worked for me in Windows XP but it appears to not work in Windows 7.  Anyone get it to work in 7? Using VS 2008, targeting a .net 2.0 app.
    N I C K
    Friday, February 5, 2010 10:41 PM
  • I'm using it with VS2008 on Win7 and it works for me.
    Saturday, February 6, 2010 7:23 AM
  • I know this is an old thread but thought I'd make a quick note for others still stuck in Windows Mobile 6.5 and below development.  You don't need to go through the hoops of adding an environment variable.  Just change the line to:

    <Target Name="PlatformVerificationTask" Condition="''false' == 'true'">

    Any 2 strings that don't match will cause the step to be skipped.

    Also to help others find things quickly, the file that needs changed (at least for v3.5) is:

    C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.CompactFramework.Common.targets

     

    Saturday, January 7, 2012 7:10 PM
  • I also encountered the problem very recently developping CF3.5 application for a Windows CE smart device.

    We were porting CF2.0 application made under VS2005 to CF3.5 with newly installed VS2008. Compilation time had become more than 7 minutes long while it was a few seconds with VS2005. VS2008 was litterally stuck with no information (just the compilation in progress icon moving to make us suppose it was not really going to crash).

    To fix it drastically, just change the line:

    <Target Name="PlatformVerificationTask">

    to:

    <Target Name="PlatformVerificationTask" Condition="'false'" >

    in the above quoted C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.CompactFramework.Common.targets file and it just works great.

    Wednesday, February 15, 2012 10:19 AM
  • There are many ways to do this without modifying Microsoft.CompactFramework.Common.targets (e.g. you might not want to do that on the build machine).

    1. Override the target
    after you include the targets file, override specific task by <Target Name="PlatformVerificationTask"></Target>

    2. Override the *DependsOn which invoke the target
    (You have to do some digging to see how that can be done)


    The FIM Password Reset Blog http://blogs.technet.com/aho/


    Thursday, July 5, 2012 1:29 AM

  • <Target
            Name="PlatformVerificationTask" Condition="0==1">
            <PlatformVerificationTask
                PlatformFamilyName="$(PlatformFamilyName)"
                PlatformID="$(PlatformID)"
                SourceAssembly="@(IntermediateAssembly)"
                ReferencePath="@(ReferencePath)"
                TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
                PlatformVersion="$(TargetFrameworkVersion)"/>

        </Target>
    Monday, June 13, 2016 9:33 PM