Friday, December 01, 2006

How to: Reference GAC'd assembly from VS2005

The other day I was trying to add a reference to an assembly that was in the Global Assembly Cache (GAC) from Visual Studio 2005. I couldn't find the assembly listed in the Add Reference dialog. I noticed that none of the GAC'd assemblies were showing up. So after a little research I found a way to add the reference. Go to the Browse tab and type the file path with assembly version and token in the File name: textbox. As an example, if you want to add a reference to the PIA interop assembly for Word 2003, you type:

C:Windows\assembly\GAC\Microsoft.Office.Interop.Word11.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Word.dll