Welcome to MSDN Blogs Sign in | Join | Help

How to add the Team Foundation assemblies to the .NET tab in the VS Add Reference dialog

To write an app using the Team Foundation API, you're going to need to reference assemblies that are in the GAC.  It's not possible to add a reference to a .NET assembly in the GAC in VS when you need to add a reference to an assembly.

The GAC'ed Team Foundation assemblies are also copied to the PrivateAssemblies folder under the VS directory.  When you want to add a reference to a TFS assembly in VS solution, you can choose Browse and find the assembly.

To make it more convenient, you can also add the TFS assemblies to the .NET tab in the Add Reference dialog.  This knowledge base article describes how to add an assembly to the list in the .NET tab.

Based on that, here's a simple batch script that will add all of the GAC'ed Team Foundation assemblies to the list.  There are probably assemblies you'll never need to use in this list, so feel free to trim it down.  You can copy the text to a file called register.bat and run it.  The batch script assumes that you installed VS in the normal Program Files directory.  Since this script modifies your registry, all of the usual disclaimers apply, you should back it up beforehand, etc.

reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation /ve /d "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies" /f
reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.Build.Common /ve /d "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies" /f
reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.Client /ve /d "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies" /f
reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.Common /ve /d "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies" /f
reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.Common.Library /ve /d "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies" /f
reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.VersionControl.Client /ve /d "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies" /f
reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.VersionControl.Common /ve /d "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies" /f
reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.VersionControl.Common.Integration /ve /d "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies" /f
reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.WorkItemTracking.Client /ve /d "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies" /f
reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.WorkItemTracking.Client.Cache /ve /d "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies" /f
reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore /ve /d "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies" /f
reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.WorkItemTracking.Client.Provision /ve /d "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies" /f
reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.WorkItemTracking.Client.QueryLanguage /ve /d "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies" /f
reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.WorkItemTracking.Client.RuleEngine /ve /d "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies" /f
reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.WorkItemTracking.Proxy /ve /d "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies" /f

After running the script, you should see the GAC'ed Team Foundation assemblies listed in the .NET tab.

[Update 1/12]  I fixed some errors in the first couple of paragraphs.

Published Thursday, January 12, 2006 7:18 AM by buckh

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: How to add the Team Foundation assemblies to the .NET tab in the VS Add Reference dialog

Thanks Buck! This is a very helpful post.

++Alan
Thursday, January 12, 2006 10:46 AM by Alan Stevens

# re: How to add the Team Foundation assemblies to the .NET tab in the VS Add Reference dialog

What about SDK documentation on that assemblies?? I have tried to search for info on them for Beta 3 Refresh but no success
Thursday, January 12, 2006 2:48 PM by Luis Fraile

# re: How to add the Team Foundation assemblies to the .NET tab in the VS Add Reference dialog

Luis, this post has the details on getting the documentation.
http://blogs.msdn.com/buckh/archive/2005/12/09/502179.aspx
Thursday, January 12, 2006 10:33 PM by buckh

# re: How to add the Team Foundation assemblies to the .NET tab in the VS Add Reference dialog

Do you really need to add one key per assembly? If I remember correctly, Visual Studio simply goes through the directory and adds all assemblies in there. So only the first row in the above script is really necessary. Right?
Tuesday, January 17, 2006 4:16 AM by Anders Ljusberg

# re: How to add the Team Foundation assemblies to the .NET tab in the VS Add Reference dialog

Personally, I like adding only what I need. However, you might be right. I haven't tried it.
Tuesday, January 17, 2006 9:30 PM by Buck Hodges

# re: How to add the Team Foundation assemblies to the .NET tab in the VS Add Reference dialog

I could not find a way to add just the directory and pick up all the assemblies, so adding a file at a time is the way to go.

If you want some more info to jump start writing a Team Foundation Version Control Add-in for Visual Studio, see http://blogs.msdn.com/edhintz/archive/2006/02/03/524312.aspx
Friday, February 03, 2006 2:35 PM by edhintz

# TFS Version Control post summary

Now that the RC is out, I thought I'd post a summary with links to version control posts from the last...
Wednesday, February 08, 2006 11:14 PM by Buck Hodges

# Listing the process templates on a TFS server

In response to a forum question about how to list the process templates on the server, Tony Edwards,...
Friday, February 24, 2006 8:32 AM by Buck Hodges

# Adicionando referências aos assemblies do Team Foundation Server no Visual Studio

Para criar soluções que integrem ou estendam o TFS, você certamente precisará referenciar um ou mais...
Wednesday, March 29, 2006 10:02 AM by Igor "T-Shooter" Abade Leite

# How to compare (diff) trees at different versions using the API

Recently the question of how to compare files and folders came up.  TFS version 1 doesn't have the...
Thursday, April 06, 2006 10:08 AM by Buck Hodges

# re: How to add the Team Foundation assemblies to the .NET tab in the VS Add Reference dialog

For Visual Studio 2008 use this:

reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation /ve /d "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies" /f

reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.Build.Common /ve /d "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies" /f

reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.Client /ve /d "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies" /f

reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.Common /ve /d "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies" /f

reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.Common.Library /ve /d "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies" /f

reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.VersionControl.Client /ve /d "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies" /f

reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.VersionControl.Common /ve /d "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies" /f

reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.VersionControl.Common.Integration /ve /d "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies" /f

reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.WorkItemTracking.Client /ve /d "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies" /f

reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.WorkItemTracking.Client.Cache /ve /d "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies" /f

reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore /ve /d "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies" /f

reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.WorkItemTracking.Client.Provision /ve /d "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies" /f

reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.WorkItemTracking.Client.QueryLanguage /ve /d "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies" /f

reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.WorkItemTracking.Client.RuleEngine /ve /d "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies" /f

reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation.WorkItemTracking.Proxy /ve /d "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies" /f

Thursday, October 30, 2008 11:09 AM by Robert Everett

# re: How to add the Team Foundation assemblies to the .NET tab in the VS Add Reference dialog

It does appear true that you only need the first line.  That will grab everything that starts with Microsoft.TeamFoundation.

If you only wanted a subset, I suppose you could use the other lines, though.  In the end, this is all I have in my .bat:

reg add HKCU\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.TeamFoundation /ve /d "%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies" /f

pause

Wednesday, December 24, 2008 5:53 PM by Andrew Backer

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker