||Carlos J. Quintero (Microsoft MVP)
||Microsoft Visual Studio 2005
||Microsoft Visual Studio 2008
||Microsoft Visual Studio 2010
||Microsoft Visual Studio 2012
When using the peverify.exe tool of the .NET Framework to verify an add-in
that references a Visual Studio assembly not in the Global Assembly Cache (GAC) but in the installation
folder of Visual Studio (such as Microsoft.VisualStudio.Data.Interop.dll), you get
Error 0x80070002 "The system cannot find the file specified"
Notice that the referenced assembly should have the Copy Local property set to
False because assemblies in the installation folder of Visual Studio should not
be redistributed. The referenced assembly will be
located correctly when the add-in is hosted in Visual Studio. It won't be found
when verifying it with the peverify.exe tool, though.
To solve this problem:
- If your add-in dll is named "myaddin.dll", create a text file with the name "myaddin.dll.config"
- Place this content inside that config file that specifies the file path of the
referenced assembly (adjust the items in bold face):
|Language: XML|| Copy Code (IE only)|
<?xml version="1.0" ?>
<assemblyIdentity name="Microsoft.VisualStudio.Data.Interop" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
href="C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Microsoft.VisualStudio.Data.Interop.dll" />
Once that file is placed in the same folder than the add-in dll, the peverify.exe
tool will work fine.
Go to the 'Visual Studio Extensibility (VSX)' web site for more articles like this (Articles section)