Tuesday, April 21, 2009

Using TFS Assemblies on Vista 64-bit

Just spent some time figuring out an issue in a Windows Forms application I am writing. It is designed to be a simple UI for generating TFS builds for BizTalk, using the MSBuild Extension Pack tasks.

In order to generate builds through the TFS API, I needed to reference some of the following assemblies:

- Microsoft.TeamFoundation
- Microsoft.TeamFoundation.Build.Client
- Microsoft.TeamFoundation.Client

After referencing these assemblies I ran the application and kept getting a runtime exception:

Could not load file or assembly 'Microsoft.TeamFoundation, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

After trying a number of steps to fix the issue it turns out that under Vista 64-bit,  the application referencing these assemblies must be compiled in in ‘x86’ mode, not ‘Any CPU’. Changing the solution configuration mode to ‘Debug | x86’ solves the issue. 

The error message isnt particularly helpful in this case so I am blogging it in case someone else strikes the same issue. Apparently TFS 2010 will be fully 64-bit compatible (at last!).

2 comments: