Freigeben über


SYSK 292: Assembly in GAC != Assembly in Add References .NET tab

Some think that .NET tab in Add References dialog shows shared assemblies residing in global assembly cache (GAC). This is incorrect.

 

The assembly list in that tab comes from assemblies found in a few folders, not GAC; and the folders themselves are listed in two (I believe) registry keys:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx

 

Try it for yourself – put your assembly (even if it’s not a strongly named) into \Program Files\Microsoft Visual Studio 8\Common7\IDE\PublicAssemblies folder and you’ll see it in the Add References .NET tab… Now, delete it from the PublicAssemblies folders, give it a strong name and register it in GAC – you won’t find it in the Add References .NET tab…

Comments

  • Anonymous
    March 30, 2007
    Thank you for posting this.  I've been trying to solve this mystery on and off for some time now and have always just put it under the same folder all of .NET assemblies live in Program Files/Microsoft.NET/Framework/(version) knowing that there was probably a better way but could never figure it.  Was never a problem until I need to have side by side versions (files where overwriting the old). Awesome!