As the others said, most of the time you won't want to do that because it doesn't copy the assembly to your project and it won't deploy with your project. However, if you're like me, and trying to add a reference that all target machines have in their GAC but it's not a .NET Framework assembly:
- Open the windows Run dialog (Windows Key + r)
- Type C:Windowsassemblygac_msil. This is some sort of weird hack that lets you browse your GAC. You can only get to it through the run dialog. Hopefully my spreading this info doesn't eventually cause Microsoft to patch it and block it. (Too paranoid? :P)
- Find your assembly and copy its path from the address bar.
- Open the Add Reference dialog in Visual Studio and choose the Browse tab.
- Paste in the path to your GAC assembly.
I don't know if there's an easier way, but I haven't found it. I also frequently use step 1-3 to place .pdb files with their GAC assemblies to make sure they're not lost when I later need to use Remote Debugger.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…