📜 ⬆️ ⬇️

Very long compilation of the .NET Framework project under Windows CE and solution.

If your seemingly simple project that you write in MS Visual Studio 2005/2008 under Windows CE is going to take a very long time (my build time was about 5 minutes), then you came to the address. I had such a problem, but almighty Google rescued me.

Diagnostics


Choose
Tools — Options — Projects and Solutions — Build and Run
In the list of MSBuild project buld output verbosity select Diagnostic . Now open the output window
View — Output
and collect the project and after a long wait at the very end of the huge log that the compiler issued, we see the following:
 Task Performance Summary: 0 ms Message 3 calls 0 ms WriteLinesToFile 2 calls 0 ms RemoveDuplicates 3 calls 0 ms FindAppConfigFile 1 calls 0 ms ConvertToAbsolutePath 1 calls 0 ms ReadLinesFromFile 2 calls 0 ms AssignTargetPath 5 calls 0 ms Delete 2 calls 0 ms MakeDir 2 calls 0 ms CreateProperty 1 calls 0 ms GetFrameworkPath 1 calls 10 ms ResolveAssemblyReference 1 calls 10 ms GetDeviceFrameworkPath 1 calls 20 ms AssignCulture 1 calls 30 ms Copy 6 calls 40 ms FindUnderPath 7 calls 60 ms ResolveComReference 1 calls 290 ms CreateCSharpManifestResourceName 1 calls 761 ms GenerateResource 1 calls 2804 ms Csc 1 calls 118073 ms PlatformVerificationTask 1 calls 
The last line is just some kind of quiet horror, right? We crack the Google and find the following . It turns out that the Platform Verification Task is a special procedure that checks whether the program that has just been compiled can run on all platforms that have the .NET Framework. In an implementation under one platform, there may be nothing that is present in the implementation under another.

Resolved, disable!

  1. Open the file
    %windir%\Microsoft.NET\Framework\v2.0.50727\Microsoft.CompactFramework.Common.Targets
    for editing.
  2. If .NET Framework 3.5 is installed, then open exactly the same file.
    %windir%\Microsoft.NET\Framework\v3.5\Microsoft.CompactFramework.Common.Targets
  3. Find the string
    Name="PlatformVerificationTask">
    and replace it with
    Name="PlatformVerificationTask" Condition="'$(SkipPlatformVerification)' != 'true'">
  4. Now we get a new environment variable. To do this, press the magic keyboard shortcut windows+break . Further
    — — —
    Variable name
    SkipPlatformVerification
    value
    true
    Now you need to restart the system, but without this, the environment variables are not updated.
    ')
    Everything! Now it should work fast.

    UPD:
    PS
    Concerning clause 4: environment variables are updated or not updated ... Here is a mystery covered in darkness. In one case, updated, in the other - no. We have a little quarrel with DarkestMaster on this ground, but everything seems to be fine.

Source: https://habr.com/ru/post/41218/


All Articles