Compiling ArcMap 10 Add-in = Build Failed

6053
4
08-23-2010 03:28 PM
ITSupport
Emerging Contributor
Hi, I am using Windows 7 x64 with Visual Studio 2010 & ArcMap 10. When compiling an add-in for ArcMap 10 in Visual Studio I get the error:

"Cannot register assembly "myaddin.dll" Could not load file or assembly "ESRI.ArcGIS.Desktop.AddIns". The system cannot find the file specified.

I have made sure the reference to the file is there & it exists. The weird thing is when I compile it again, it comiles fine without error. Really annoying, every time I want to compile my project I have to compile it twice in order for it to succeed. Has anyone else seen this or know how to fix it?

Thanks
Tony
0 Kudos
4 Replies
EagerIp
Deactivated User
Hi Tony,

Did you create the project from scratch in Visual Studio 2010 or it's an upgrade from 2008? What is the target .NET framework set for the add-in project? 

Since an add-in project should not be registered with COM, make sure "Register for COM interop" is unchecked and the ESRI.ArcGIS.Deskop.AddIns assembly reference Copy Local property set to false.

If the above doesn't fix the build problem, a full build log from the output window should help to diagnose this. You may want to change the MSBuild verbosity to Normal/Detailed in the Visual Studio Options dialog (Tools > Option, Projects and Solutions > Build and Run) before pasting the log here.
ITSupport
Emerging Contributor
Hi sorpobear

The "Register for COM interop" was ticked. I unticked it & the problem went away.
Things are a done little different with Add-ins but I like it.

Thanks
Tony
0 Kudos
RaymolRappai
Emerging Contributor
Hi,
I am working on esri Addin, Visual Studio 2010, Platform target x86, Target Framework 3.5, ArcMap 10.1
I am referencing DSOFile.dll from Microsoft. I have the Register for COM Interop unchecked,  ESRI.ArcGIS.Desktop.AddIns copy Local set to false, DSOFile copy Local set to true. The dsofile is 32 bit.
When I release build the Addin the DSOFile.dll does not get referenced.  I will have to copy the dll and regserv32 the dll to get the addIn to work on the newly installed computer.
Any help is appreciated.
I have attached the detailed build log file for reference.
Thanks Again
0 Kudos
DimitarKolev
Emerging Contributor
Same thing here. I am developing ArcMap AddIn and I have to reference external ActiveX Interface that is not registered in GAC, so I need the "Register for COM interop"  box checked. I also added Pre-build event:
C:\windows\microsoft.net\Framework\v2.0.50727\regasm.exe /codebase "C:\Program Files (x86)\TestActiveX\IActiveX\AxIGISLink.dll"

I am getting the same build error:
Could not load file or assembly 'ESRI.ArcGIS.Desktop.AddIns, Version=10.1.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86'
or one of its dependencies. The system cannot find the file specified.

Is there workaround here?

Thanks,
D.
0 Kudos