Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoreHost samples don't work - Unable to load DLL 'CoreInterop.dll' #30

Closed
fabian-ortega opened this issue Sep 20, 2018 · 9 comments
Closed

Comments

@fabian-ortega
Copy link

Hi,

I'm getting an error while executing the samples about the "[CoreHost] (https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/CoreHost)" module.

I downloaded all the samples from the repository (https://github.com/Esri/arcgis-pro-sdk-community-samples) and focused on the "CoreHostSample (https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/CoreHost/CoreHostSample)" project, updated the ArcGIS.Core.dll and ArcGIS.CoreHost.dll references and changed the GDB file path for an existing one. Then I execute the project and, while debugging the file Program.cs, the method "Host.Initialize();" work fine but on the next executing line "using (var gdb = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(gdbPath, UriKind.Absolute)))) {", I get the following error:

System.DllNotFoundException
  HResult=0x80131524
  Message=System.DllNotFoundException: 'Unable to load DLL 'CoreInterop.dll': The specified module could not be found. (Exception from HRESULT : 0x8007007E)'
  Source=ArcGIS.Core

The error says that the DLL 'CoreInterop.dll' is missing but the documentation never mentioned that we have to add a reference to this DLL, it only refers to "ArcGIS.Core.dll" and "ArcGIS.CoreHost.dll". And even if I add the reference of the library "CoreInterop.dll" myself, it doesn't work.

I followed all the instructions in this link:
https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/CoreHost/CoreHostSample
and here:
https://github.com/esri/arcgis-pro-sdk/wiki/proconcepts-CoreHost

I'm using:

  • Visual Studio Community 2017 (v15.7.5) with .NET Framework 4.6.1
  • ArcGIS Pro 2.2.1
  • ArcGIS Pro SDK for .NET 2.2.0.12813

Do these samples (about the "CoreHost" module) work for you? Can anybody help me with this issue please?

Best regards,
Fabian

@UmaHarano
Copy link
Contributor

Hi Fabian
On your machine, are ArcGIS.Core.dll and ArcGIS.CoreHost.dll located in the Pro Installation location?
In Visual Studio are the properties for these 2 dlls set to "Copy Local True"?

Thanks
Uma

@fabian-ortega
Copy link
Author

Hi Uma,

Thank you for your reply.

Regarding your first question, yes, both libraries are located in "C:\Program Files\ArcGIS\Pro\bin", as you can see in the picture below.

image

And about your second question, yes, the property "Copy Local=True" was set that way already. Actually, after downloading the samples solution from the repository, in the CoreHostSample project, I only changed the GDB file path for an existing one and updated the ArcGIS.Core.dll and ArcGIS.CoreHost.dll references pointing to the ArcGIS Pro Installation location ("C:\Program Files\ArcGIS\Pro\bin").

I was thinking that maybe there's an old dependency from one of these 2 DLLs to 'CoreInterop.dll', so I tried to add the reference myself but I get this error :

image

Do you have any idea why I'm getting this error? Does the CoreHostSample project work fine for you when you execute it?

Thanks again for your help,
Fabian

@UmaHarano
Copy link
Contributor

Hi Fabian
Yes, the sample from GitHub works for me using Pro 2.2. If you would like, you can zip up your project and send it over via GeoNet and I can check it out.

Thanks
Uma

@fabian-ortega
Copy link
Author

Hi Uma,
That'd be very helpful, thanks, I'll start a new discussion on GeoNet and send you my project right now.
Fabian

@fabian-ortega
Copy link
Author

Hi again,
I just sent you my project throught GeoNet, this is the link:
https://community.esri.com/docs/DOC-12451-corehostsamplezip

For information, I'm running this project on:

  • Windows 7 Professional SP1 x64 (8GB of RAM )
  • ArcGIS Pro 2.2.2
  • ArcGIS Pro SDK for .NET (version 2.2.0.12813)
  • Visual Studio Enterprise 2017 (version 15.8.5)
  • .NET Framework 4.6.1

Thanks,
Fabian

@UmaHarano
Copy link
Contributor

Hi Fabian
I downloaded your sample and tried it on a Windows 7 machine with Visual Studio 2017 (15.8.5 version). No luck, I was unable to see the error. The sample worked correctly and displayed the information. I also duplicated your path and file gdb name in my test. Not sure why you are seeing this problem. Have you tried repairing your Pro Setup perhaps?

Thanks
Uma

@fabian-ortega
Copy link
Author

Hi Uma,
I just downloaded the last version of ArcGIS Pro (https://my.esri.com/#/downloads/ArcGIS%20Pro/2.2), the filename is "ArcGISPro_22_163783.exe" => ArcGIS Pro 2.2.2, launched the .exe to repair the install, retested the code but the error is still there:

image

We have the exact same versions of Visual Studio, ArcGIS Pro, ArcGIS Pro SDK for .NET and we executed the same code on Windows 7, it's really, really weird, I'm running out of ideas... if you have any other suggestion or idea, I'd appreciate it a lot.

Thanks again for your help.
Fabian

@UmaHarano
Copy link
Contributor

Hi Fabian

Couple of things to check out:

  1. Just to confirm, Pro works and runs on this machine, correct?
  2. Copy the CoreHostSample.exe created by the sample to the Pro's bin folder. C:\Program Files\ArcGIS\Pro\bin. Double click the exe and check if it runs.

Thanks
Uma

@fabian-ortega
Copy link
Author

Hi Uma,

  1. Yes ArcGIS Pro works and runs on this machine.
  2. I did the test and the code worked like a charm !

I also tried adding the Pro's bin folder path (C:\Program Files\ArcGIS\Pro\bin) to the PATH System Environment Variable, and it also worked perfectly, even while executing it from Visual Studio ! So I'm not stuck anymore, I can continue working on my console application based on ArcGIS Pro.

Thank you very much for your help.
Best regards,
Fabian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants