Wednesday, October 13, 2010

How to build Visual Studio 2010 Extensions thru 64bit Team Build

There has been a lot of great things added to Visual Studio 2010, specifically around creating custom Add-in/Extensions/Tool Windows/etc..  You download the Visual Studio 2010 SDK and off you go enhancing your development experience.

The one challenge I’ve had is trying to get these extensions to build thru Team Build 2010.  First few times I didn’t really bother with it to much, just chalked it up to something strange in the way the SDK does the packaging.

I started to dig into it and hit this little article.  So I logged onto my build box, opened a Visual Studio 2010 Command prompt, and it built from my command prompt.  Hmmm interesting.

Then my friend, the “where” command, tells me I’m running the 32bit version of MSBuild.  Of course since the default Visual Studio 2010 Command Prompt sets you up with the 32bit environment variables.  Makes sense.  DevEnv (Visual Studio main program) is also currently only 32bit.

So as an experiment, since the builds I’m doing don’t require to compile for x64, I found where to tell Team Build to use the 32bit version of MSBuild instead of defaulting to the version of the host process (aka 32bit for Visual Studio and CMD.EXE, 64bit for Team Build).

Open up your Build Workflow in Visual Studio and:

  • Open Sequence
  • Open Run On Agent
  • Open Sequence
  • Open Compile, Test
  • Open Try Compile and Test
  • Open Compile and Test
  • Open For Each Configuration….
  • Open Compile and Test….
  • Open For Each Project in BuildSettings.ProjectsToBuild
  • Open Try To Compile the Project

You should see something like this:

image

Right Mouse click on “Run MSBuild for Project”

image

Change the ToolPath variable to the 32bit directory for .Net (C:\Windows\Microsoft.NET\Framework\v4.0.30319 for example).

And your off!

No comments:

Post a Comment