Friday, July 10, 2009

Using TFS SDK on 64-bit machine

Hi, guys!

Using the TFS SDK is pretty easy. You read some articles and documentation from the msdn: Team Foundation Server SDK. Then just add the appropriate assemblies (for example Microsoft.TeamFoundation.Client and Microsoft.TreamFoundation.WorkItemTracking.Client) and enjoy writing TFS accessing applications.

What's the problem with 64-bit machine?
Creating and building the project is easy. Some problems occur when you try to run it, though. I encountered error like this one:

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

The problem is that it appears that the TFS SDK is only x86 (32-bit).

The solution
What you have to do is just change the Platform target to x86 in the Project/Properties/Build tab in your Visual Studio, and everything will work again for you. It sounds very easy, but I wasted few hours to figure this out.

Happy Coding!