Select to view content in your preferred language

ArcGIS CoreHost application - can't open FGDB - older ArcGIS Pro

172
2
Jump to solution
12-03-2024 02:26 AM
PieterLinks
Occasional Contributor

Hello,

On my PC with ArcGIS Pro 3.4 and VS 2022 I made an CoreHost C#  x64 application. The assemblies ArcGIS.Core and .CoreHost are Copy Local = Yes and Specific Version = No.

My colleague runs ArcGIS Pro 3.1.3 and the app - after installing .Net 8 - can't open a file geodatabase (but I can!). Instead he gets this errormessage:

System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
   at ArcGIS.Core.Internal.Interop.GetInterface(Guid& id, Object& obj)
   at ArcGIS.Core.Internal.Interop.get_Geodatabase()
   at ArcGIS.Core.Data.GeodatabaseUtil.OpenDatastore(String path)
   at ArcGIS.Core.Data.Geodatabase.Open(Uri uri)
   at ArcGIS.Core.Data.Geodatabase..ctor(FileGeodatabaseConnectionPath connectionPath)
   at (my code)

 

 

Uri uri = new(fgdbPath);
Geodatabase geodatabase = null;

if (fgdbPath.EndsWith(".gdb"))
{
    FileGeodatabaseConnectionPath connPath = new(uri);
    geodatabase = new(connPath); // --- here the code breaks ---
}
else if (fgdbPath.EndsWith(".geodatabase"))
{
    MobileGeodatabaseConnectionPath connPath = new(uri);
    geodatabase = new(connPath); // here the code breaks I suppose (but not tried)
}

 

 

My question:

- does it have anything to do with the older ArcGIS Pro version? If so, what should I do, unless upgrading all ArcGIS Pro installations?

Many thanks,

Pieter

0 Kudos
1 Solution

Accepted Solutions
CharlesMacleod
Esri Regular Contributor

3.1.3 was .NET 6. he will need to recompile against the .3.1 assemblies.

View solution in original post

0 Kudos
2 Replies
CharlesMacleod
Esri Regular Contributor

3.1.3 was .NET 6. he will need to recompile against the .3.1 assemblies.

0 Kudos
PieterLinks
Occasional Contributor

Thanks for your answer. After a few days off the office, I've found a workaround: running the program on a virtual server with 3.4 which my colleague can access. I do not have administrative rights so for me this is the only way.

0 Kudos