2

Attempts to initialize an ArcObjects license fails in a 64 bit process. The same code works fine in 32 bit process.

Update: I'm able to bind to the server runtime in 64 bit console app on a machine where Server is installed (but where desktop is not authorized). Next I will attempt to do this on a machine where Server is installed but not authorized. (Desktop is installed and authorized.)

While some are under the impression that ArcObjects won't work in 64 bit mode, I know this is not true. I've written custom GP Tools using ArcObjects that run in 64 bit Background Geoprocessing. In a GPTool however, I don't have to deal with initializing a license. But now, I need to.

How do I initialize an arcobjects license in a 64 bit process?

Eventually the .NET class library assembly needs to be called from a module built with ArcGIS Pro SDK v1.4. For now I'm just trying to use it from a simple console app. I'm assuming in both cases I'll need to initialize an arcobjects after calling RuntimeManager.Bind, which is in the ESRI.ArcGIS.Version assembly.

The library works in 32 bit mode, but I get a runtime exception when it tries to load the assembly in 64 bit mode:

An unhandled exception of type 'System.DllNotFoundException' 
occurred in ESRI.ArcGIS.Version.dll

Additional information: Unable to load DLL 'ArcGISVersion.dll': 
The specified module could not be found. (Exception from HRESULT: 0x8007007E)

I tried registering the dll:

%windir%\syswow64\regsvr32 "C:\Program Files (x86)\Common Files\ArcGIS
\bin\ArcGISVersion.dll"

But get same error. I've downloaded and installed the Background Geoprocessing package.

  • Maybe a stupid question, Kirk, but why aren't you using the Pro ArcObjects? – mkennedy Feb 23 '17 at 22:18
  • I'm working on a project with legacy ArcObjects based assemblies. We'd like to get it working in Pro without completely re-writing it. (Many lines of code). – Kirk Kuykendall Feb 24 '17 at 1:30
  • C:\Program Files (x86)\Common Files\ArcGIS\bin\ArcGISVersion.dll is a 32bit dll, you cannot call it from 64bit code. There is no legacy 64bit ArcObjects that I've ever witnessed; yes, there's 64bit python background geoprocessing dlls' but that's not ArcObjects, not the full set of interfaces and classes. – Michael Stimson Feb 27 '17 at 22:23
  • This kb article describes how to register a custom arcobjects-based GP tool, so that it runs within the background geoprocessor, which is 64 bit. Here's the code it references in github can run in 64 bit mode. Since Pro is 64 bit, I was thinking I should be able to run similar code within an extension there. – Kirk Kuykendall Mar 1 '17 at 0:23
1

I installed - but did not authorize - ArcGIS Server on my machine.

I was then able to set references in my Visual Studio ArcGIS Pro project to the Esri.ArcGIS assemblies, compile and use them in their full x64 glory.

Interestingly, I didn't need to initialize a license before using them in Pro, as was required in a standalone x64 exe.

  • Very interesting finding, thanks for sharing. Crazy setup you have. :) – Alex Tereshenkov Mar 18 '17 at 19:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.