Thursday, January 10, 2008

GAC Spelunking

I've been working on a tool based on the .NET 3.5 framework to unify our old software change management tools with TFS. I published the ClickOnce application but of course had forgotten to set the TFS 'Copy Local' references to True. I quickly discovered that there were a number of supporting TFS assemblies that needed to be included in my ClickOnce application manifest so I started a trial and error process of adding them all from C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies. A couple of failed installs later I hit a wall trying to find 9.0 version of Microsoft.TeamFoundation.WorkItemTracking.Proxy.dll. This assembly was in the GAC but not accessible on my file system. I remembered a trick using the SUBST command to map the GAC to a drive.

subst M: c:\Windows\assembly\gac_32

M:\>dir *TeamFoundation.WorkItemTracking*
Volume in drive M has no label.
Volume Serial Number is 9C00-A7F3

Directory of M:\

12/03/2007 01:45 PM Microsoft.TeamFoundation.WorkItemTracking.Client
12/03/2007 01:45 PM Microsoft.TeamFoundation.WorkItemTracking.Client.Cache
12/03/2007 01:45 PM Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore
12/03/2007 01:45 PM Microsoft.TeamFoundation.WorkItemTracking.Client.Provision
12/03/2007 12:42 PM Microsoft.TeamFoundation.WorkItemTracking.Client.QueryLanguage
12/03/2007 01:45 PM Microsoft.TeamFoundation.WorkItemTracking.Client.RuleEngine
12/03/2007 01:45 PM Microsoft.TeamFoundation.WorkItemTracking.Proxy

0 File(s) 0 bytes
7 Dir(s) 30,894,231,552 bytes free

M:\>cd *Proxy*

M:\Microsoft.TeamFoundation.WorkItemTracking.Proxy>cd 9.0*


Volume in drive M has no label.
Volume Serial Number is 9C00-A7F3

Directory of M:\Microsoft.TeamFoundation.WorkItemTracking.Proxy\

12/03/2007 01:43 PM .
12/03/2007 01:43 PM ..
12/03/2007 01:43 PM 122,880 Microsoft.TeamFoundation.WorkItemTracking.Proxy.dll
1 File(s) 122,880 bytes
2 Dir(s) 30,893,748,224 bytes free


The assembly is now exposed and can be copied to a location that can be referenced by VS2008. Crisis averted.

No comments:

Post a Comment