ArcGIS.Desktop.Core.Geoprocessing in standalone ArcGIS Pro SDK app

979
6
Jump to solution
02-25-2019 06:05 AM
SverkerNorlander
Esri Contributor

So, I am trying to create a standalone app with the Pro SDK to run a geoprocessing tool (Register with Geodatabase).
First of all, I call ArcGIS.Desktop.Core.Geoprocessing.Geoprocessing.MakeValueArray(object[] args)
This call fails with

"System.NullReferenceException: Object reference not set to an instance of an object".

I've debugged this to the FindModule function in ArcGIS.Desktop.Framework.Contracts.Module and it comes down to the code:

if (FrameworkApplication._this == null)
    return (ArcGIS.Desktop.Framework.Contracts.Module) null;

Which is always true in my standalone application. I guess that this means that MakeValueArray() does not work in standalone mode? Or can I create my own FrameworkApplication without starting ArcGIS Pro?

0 Kudos
1 Solution

Accepted Solutions
RichRuh
Esri Regular Contributor

Sverker,

CoreHost applications don't have access to any of the ArcGIS.Desktop assemblies.  To execute a geoprocessing tool, you have to shell out to an external process and call Python directly.

--Rich

View solution in original post

6 Replies
RichRuh
Esri Regular Contributor

Sverker,

CoreHost applications don't have access to any of the ArcGIS.Desktop assemblies.  To execute a geoprocessing tool, you have to shell out to an external process and call Python directly.

--Rich

SverkerNorlander
Esri Contributor

Thanks Rich!

That's what I thought and calling a python process was the solution I was thinking about using.

0 Kudos
philippenn
Occasional Contributor

Not sure what the point is of CoreHost apps if they don't have access to basic functionality like invoking GP tools...is there any plan to extend the API to work with ArcGIS.Desktop assemblies? Also not sure how else to write Unit Tests without this ability...

RichRuh
Esri Regular Contributor

There are no plans that I am aware of.  Many customers are using CoreHost for data migration and similar applications.

--Rich

0 Kudos
JamieKelly1
Occasional Contributor

I am trying to re-write older ArcObject (ArcGIS 10.8) to reproduce some background processing that updates a feature class by first deleting all the rows and then appending all new data from an interim in memory feature class.  I ran into a wall when trying to call the geoprocessing tools DeleteFeatures and Append - well actually it was the Geoprocessing.MakeValueArray() that failed.  Reading this, looks like it is not possible.  Not a good experience of "Upgrade", loosing functionality.

0 Kudos
JamieKelly1
Occasional Contributor

Actually, just found the deleteFeatures method on the table object - That's 1+ for improvement.  Maybe there is an Append or Copy features that I haven't found yet in the new API.  Sorry for the negative comments before about the new SDK.

0 Kudos