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

2020-07-23 06:24发布

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.

2条回答
我命由我不由天
2楼-- · 2020-07-23 07:05

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.

查看更多
3楼-- · 2020-07-23 07:16

Try downloading this link. http://www.microsoft.com/downloads/en/confirmation.aspx?familyid=3c9a983a-ac14-4125-8ba0-d36d67e0f4ad&displaylang=en

Here you get a self extracting cab file, choose a location to uncompress and there you get the msi file to install.

Installing msi file wont get you to see the dll files. Hence extract it using the tool available at http://lessmsi.activescott.com/.

This gives you option to choose the dll files you want to extract. Now this gives you the dlls of Office 11.

Do the same for Office 12 from here: http://www.microsoft.com/download/en/confirmation.aspx?id=18346

Or for Office 14 from here: http://www.microsoft.com/en-in/download/confirmation.aspx?id=3508

查看更多
登录 后发表回答