Wednesday 12 October 2011

Visual Studio Not Showing GAC Assemblies

While using Visual Studio 2010 i recently noticed that i couldnt see references to the Microsoft.SQLServer set of dlls.
I could see them if I went to C:\Windows\assembly.
They were definitely installed - and i could manually reference them by browsing to:
C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies\

And in fact my project was using them...
Other websites suggested that they should be listed under the .Net tab when adding references.
I checked the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework
and under AssemblyFolders i had the key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\SQL Server Assemblies - with the value: C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies\

I then found this article:
See section "To display an assembly in the Add Reference dialog box"

So i tried adding this key to the registry:


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\SQL Server Assemblies

Restarted visual studio, and now my .Net assemblies are back under the .Net tab...

UPDATE:

I have just installed the DirectX 9 with managed code support SDK...
the same problem. I was able to find this:
http://connect.microsoft.com/VisualStudio/feedback/details/464577/

"The underlying issue is that AssemblyFolders is not multi-targeting aware and so does not work well with our new multi-targeting features in VS 2010. AssemblyFoldersEx is version specific and so works with multi-targeting.
If you have a control that works with multiple versions of the .Net Framework you register it with the lowest version of the framework that it works with. So for example if you have a control that works with .Net 3.0 and up you would register it under the .Net 3.0 entry of AssemblyFoldersEx. It would then show up in the Choose Items and Add References dialog for 3.projects targeting 3.0, 3.5 and 4.0 but not projects targeting 2.0. "

The libraries that i have been trying to install are not aware of this and so just use the old registry location