Oddly enough, you can't use the Add Reference... dialog box to reference an assembly from the GAC in either VS2005 or VS2008. It seems completely counter-intuitive, but it's true. Many developers actually think that the .NET tab of the Add Reference... dialog box is the GAC listing, which, again, is not true.
So why do some GACed assemblies appear in the list while others don't? First of all, the assembly must not only exist in the GAC (e.g. c:\windows\assembly), it must also exist elsewhere on the system. Most often, these assemblies live in the Program Files\Vendor\... directory. Secondly, a registry entry tells Visual Studio what directories to scan for assemblies.
However, some vendors just install assemblies directly into the GAC, making it impossible for Visual Studio to reference them.
However, there are ways around this problem. The one I use most often involves SharpDevelop and is obscenely simple.
- Download and install the latest stable version of SharpDevelop.
- Next, open your solution in SharpDevelop. Go to the Project menu and select the Add Reference. Go to the GAC tab and pick whatever assembly you want.
- Save the solution and you are done.
There is one small issue though - SharpDevelop does not support any type of web projects, particularly Web Site project type. For this type of project, you must manually add the GACed assembly into the web.config. The referenced assemblies are typically held in the configuration/system.web/assemblies area. Add your assembly there and make sure that the Version and PublicKeyToken match the GAC.