Search code examples
dllinteropgacfxcop

Getting to Microsoft.Office.Interop.Word.dll?


When FxCop examines an assembly it gives the following error:

The following reference assembly could not be found.  The assembly is
required for analysis and was referenced by Test.dll.

Microsoft.Office.Interop.Word, Version=12.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c

So, I did a search and found the file in:
C:\Windows\assembly\GAC\Microsoft.Office.Interop.Word\12.0.0.0__71e9bce111e9429c

However, the dialog in FxCop doesn't let me get past C:\Windows\assembly. It looks like Microsoft hacked this directory to show up different in the common dialogs, but forgot to tell the FxCop team.

So how do I get FxCop to find that dll?

BTW: This is Windows XP.


Solution

  • I've had to deal with this before. My solution was to copy the necessary files to a libs folder adjacent to my src directory, and reference that copied file instead. During compilation, it should get copied into the build folder along with your project's build results, and FxCop should have no issue picking it up.

    I think the issue is that assemblies in the GAC don't get copied to your project's build folder, and FxCop doesn't know how to handle non-framework GAC references.