tags:

views:

27

answers:

3

I need to reference Team Foundation assemblies in my project but I cannot.

When looking for Microsoft.TeamFoundation.* in the GAC I cannot find any assemblies. Then I browse to C:\windows\assembly and here I find the assemblies that I need. When I select all or one of the assemblies to create a reference nothing happens. The dialog 'blinks' and returns focus to the top of the list. The reference is not created?! I have tried this with other assemblies in this directory and I cannot make a reference to any of them.

I restarted VS and tried again. No luck. So how do I reference these Dlls? I have TFS installed on this machine.

Thanks..

+1  A: 

These assemblies are installed for x64 at
- %ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0
- %ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies

and for x86 at
- %ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0
- %ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies

Ewald Hofman
Not on my system..
Nick
@Nick: You may have to massage the version number a little, depending on your version of the TFS client.
kbrimington
Did you install Team Explorer? Which version of TFS are you talking about?
Ewald Hofman
A: 

Our TFS guy gave us a bunch of registry hacks to make the assembly visible in Visual Studio via this resource:

http://blogs.msdn.com/b/buckh/archive/2006/01/12/how-to-add-the-team-foundation-assemblies-to-the-net-tab-in-the-vs-add-reference-dialog.aspx

He had to hand-massage the version numbers, as we were using 2008 (the resource is for 2005).

I don't like it, being a registry hack, so I always used Browse... references to the libraries as described by @Ewald. The assembly loader is smart enough to check the GAC in spite of my local reference. I would copy the assemblies into a folder within my project so as to avoid external dependencies to relative paths far from my source control tree.

kbrimington
A: 

It seems that Microsoft.TeamFoundation assemblies work only when the target platform is set to x86.

Setting the target platform of my project to x86 resolved the issue.

Nick