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

Buck Hodges

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 HKCUSoftwareMicrosoft.NETFrameworkAssemblyFoldersMicrosoft.TeamFoundation /ve /d “%programfiles%Microsoft Visual Studio 8Common7IDEPrivateAssemblies” /f
reg add HKCUSoftwareMicrosoft.NETFrameworkAssemblyFoldersMicrosoft.TeamFoundation.Build.Common /ve /d “%programfiles%Microsoft Visual Studio 8Common7IDEPrivateAssemblies” /f
reg add HKCUSoftwareMicrosoft.NETFrameworkAssemblyFoldersMicrosoft.TeamFoundation.Client /ve /d “%programfiles%Microsoft Visual Studio 8Common7IDEPrivateAssemblies” /f
reg add HKCUSoftwareMicrosoft.NETFrameworkAssemblyFoldersMicrosoft.TeamFoundation.Common /ve /d “%programfiles%Microsoft Visual Studio 8Common7IDEPrivateAssemblies” /f
reg add HKCUSoftwareMicrosoft.NETFrameworkAssemblyFoldersMicrosoft.TeamFoundation.Common.Library /ve /d “%programfiles%Microsoft Visual Studio 8Common7IDEPrivateAssemblies” /f
reg add HKCUSoftwareMicrosoft.NETFrameworkAssemblyFoldersMicrosoft.TeamFoundation.VersionControl.Client /ve /d “%programfiles%Microsoft Visual Studio 8Common7IDEPrivateAssemblies” /f
reg add HKCUSoftwareMicrosoft.NETFrameworkAssemblyFoldersMicrosoft.TeamFoundation.VersionControl.Common /ve /d “%programfiles%Microsoft Visual Studio 8Common7IDEPrivateAssemblies” /f
reg add HKCUSoftwareMicrosoft.NETFrameworkAssemblyFoldersMicrosoft.TeamFoundation.VersionControl.Common.Integration /ve /d “%programfiles%Microsoft Visual Studio 8Common7IDEPrivateAssemblies” /f
reg add HKCUSoftwareMicrosoft.NETFrameworkAssemblyFoldersMicrosoft.TeamFoundation.WorkItemTracking.Client /ve /d “%programfiles%Microsoft Visual Studio 8Common7IDEPrivateAssemblies” /f
reg add HKCUSoftwareMicrosoft.NETFrameworkAssemblyFoldersMicrosoft.TeamFoundation.WorkItemTracking.Client.Cache /ve /d “%programfiles%Microsoft Visual Studio 8Common7IDEPrivateAssemblies” /f
reg add HKCUSoftwareMicrosoft.NETFrameworkAssemblyFoldersMicrosoft.TeamFoundation.WorkItemTracking.Client.DataStore /ve /d “%programfiles%Microsoft Visual Studio 8Common7IDEPrivateAssemblies” /f
reg add HKCUSoftwareMicrosoft.NETFrameworkAssemblyFoldersMicrosoft.TeamFoundation.WorkItemTracking.Client.Provision /ve /d “%programfiles%Microsoft Visual Studio 8Common7IDEPrivateAssemblies” /f
reg add HKCUSoftwareMicrosoft.NETFrameworkAssemblyFoldersMicrosoft.TeamFoundation.WorkItemTracking.Client.QueryLanguage /ve /d “%programfiles%Microsoft Visual Studio 8Common7IDEPrivateAssemblies” /f
reg add HKCUSoftwareMicrosoft.NETFrameworkAssemblyFoldersMicrosoft.TeamFoundation.WorkItemTracking.Client.RuleEngine /ve /d “%programfiles%Microsoft Visual Studio 8Common7IDEPrivateAssemblies” /f
reg add HKCUSoftwareMicrosoft.NETFrameworkAssemblyFoldersMicrosoft.TeamFoundation.WorkItemTracking.Proxy /ve /d “%programfiles%Microsoft Visual Studio 8Common7IDEPrivateAssemblies” /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.

0 comments

Leave a comment

Feedback usabilla icon