Friday, July 10, 2009

Using TFS SDK on 64-bit machine

Hi, guys!

TFS SDK
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=9.0.0.0, 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!

4 comments:

DIEGO said...

I had the same problem.

I changed plataform to x86 and it work's fine.

Tks.

Javier said...

Thank you! I had the same problem and your solution fixed the problem

Anonymous said...

Thanks for this post. Useful.

Anonymous said...

Thanks for this post!! I had the same problem and now it works fine:)