Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Mobile 6.5 build time (VS2008)

I have a small windows mobile app with roughly 25 forms and maybe 50 classes split into 3 projects. When I'm building the project it takes 25 to 40 minutes for a normal CTRL-SHIFT-B in debug mode.

I have tried the skip platform verification hack, but it doesn't seem to help.

The environment is VS 2008
Windows Mobile 6.5.3
Compact Framework 2.0

<ProductVersion>9.0.30729</ProductVersion>
<OSVersion>5.02</OSVersion>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<NativePlatformName>Windows Mobile 6.5.3 Professional DTK</NativePlatformName>

The computer is an HP EliteBook 8440p with a i3 @2,4Ghz, 4gb ram.
There is plenty Ram available (2,2 Gb used).
CPU usage around 25% during compilation.

When I build, visual studio and all of it's child windows goes blank for 95% of the time.

The eventviewer doesn't show any particular warnings like a bad hard disk or so.

Update 1

In the process monitor trace I can see that there's regular network activity in devenv.exe during the build. Could VSS have something to do with the build? (I reach the vss-repository through a vpn tunnel that I have had in bypass mode today.)

like image 377
Carl R Avatar asked Nov 04 '22 11:11

Carl R


1 Answers

First the good news: you can shorten long build times and
here we go with the "bad news", the work:

  1. Try building it with MSBuild to avoid VS2008 to interupt or freeze build
  2. Try than to figure out, why your build is slow, you can watch the log go while building.
  3. Write down the parts which are special slow
  4. Try to fix the "long build time issue" by speeding up the slowest Projects first. Do this as long as you want a better performance or until there is no more project to speed up.

Common issues during Build:

  1. Com References can slow down your build if tehy are not build seperatly (TLBIMP.exe)
    try to build the interop libraries first, and than use them whereever youe want
  2. Post/PreBuild events can do some usfull but slow stuff... Clean them up and remove them wherever possible
    Use the Run when build updates the project output in the BuildEvents Properties of the Project to call the PostBuild events only if the Build changes the binaries.
  3. References in Soultion File stop your MSBUILD build so you should definitly fix them up to be in the project files
  4. Try to deploy directly/once deploying after build of every Project is slower than deploying after build the solution, make a "dist.bat" which firsts Builds and then deploys.

You can use a Visual Studio Macro to start your MSBUILD for the curently opened solution:

Public Module Builder

    Sub BuildSolutionDebug()
        SaveAll()
        Run("", "C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe", """" & GetSolutionName() & """ /t:ReBuild /p:Configuration=Debug /p:Platform=""Mixed Platforms""")
    End Sub

    Sub Run(ByVal folder As String, ByVal file As String, ByVal arguments As String)
        Dim process As New System.Diagnostics.Process()
        process.Start(System.IO.Path.Combine(folder, file), arguments)
        Try
            process.WaitForExit()
        Catch ex As Exception

        End Try

    End Sub

    Sub SaveAll()
        DTE.ExecuteCommand("File.SaveAll")
    End Sub

    Function GetSolutionName() As String
        Return DTE.Solution.FullName
    End Function

End Module

Please contact me if you have further questions or want to discuss a point. I would be glad helping you.
I would also enjoy reading your solution to the problem, and in which point your build was slow!

like image 89
oberfreak Avatar answered Nov 12 '22 20:11

oberfreak