Wednesday, August 23, 2006

AJ Thows Out First Pitch for the Twins!


My buddy AJ recently had the honor of throwing out the first pitch at a Twins home game!

From AJ: "It was as close to awesome as you can get! If you notice the goofy smile on my face while on the mound, that was completely unavoidable. I was smiling uncontrollably. ;) Anyway, when it came time to do the pitch, I took my time and did the full windup. Everything was feeling good... until I let go of the ball! It sailed about ten feet over home plate. Not even the Twin mascot, TC Bear, could catch it. The ball banged off the back wall and I felt a bit silly. I never was a very good pitcher. I kept thinking about the quote from the movie "Bull Durham"... "HIT THE BULL!" But despite that minor hickup, it was still a terrific experience. I passed right by Harmon Killewbrew and Tony Oliva in the tunnel out to the field. Also, Gardy walked right by us on his way to the dugout - he said hello to the girls. Good times."



Thursday, August 17, 2006

Automate build of Windows Moble CAB file from NAnt

We call MSBuild from NAnt to build our software, and it has worked really well up to now, but we came across an issue with building our new mobile software. This is a Windows Mobile 2003 device app, and the output of the release is a CAB file that you can deploy on the mobile devices.

The problem comes from the fact that MSBuild does not support building deployment projects, including mobile CAB files. When I tried to build the CAB project using MSBuild, the NAnt log showed this message:

warning MSB4078: The project file "MyCAB.vddproj" is not supported by MSBuild and cannot be built.

The workaround I found was to use devenv from the command line.

"c:\program files\Microsoft Visual Studio 8\Common7\IDE\devenv" C:\dev\MyMobileApp.sln /build release /safemode

Use the /build switch instead of the /deploy, since the /deploy switch will try to launch the software in the emulator or on a activesynch'd device.

I used the /safemode flag because it ostensibly loads a minimal set of drivers for stability. It is probably not necessary, though.

To get this working in NAnt, I added some code to a custom NAnt task that was already running for this project like this (inside XML tags):


exec
program="c:\program files\Microsoft Visual Studio 8\Common7\IDE\devenv"
commandline="${vss.bin.dir}\Application\${application.name}.sln /Build Release /SafeMode"


****
I hope this post helps someone; this is probably pretty basic stuff, but I would've saved a couple of hours if I could've found this info in once place when I came across the problem.


UPDATE
I ran across some additional problems -- the CABs being created by devenv did not include all the assemblies that were referenced; the issue was that our automated build process was incrementing the version number on each build, and in order for the CAB to build correctly you need to manually "refresh dependencies" on the CAB project.

The final resolution was to download the Windows Mobile 2003 SDK and run "CabWiz" from the command line. I used the "inf" file that was generated by Visual Studio 2005 (make sure to convert it from Unicode to Ansi text first) and everything worked like a charm.

This page is powered by Blogger. Isn't yours?