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

446
4
Jump to solution
02-25-2019 06:05 AM
New Contributor III

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?

Reply
0 Kudos
1 Solution

Accepted Solutions
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

4 Replies
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

New Contributor III

Thanks Rich!

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

Reply
0 Kudos
New Contributor III

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...

Reply
0 Kudos
Esri Regular Contributor

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

--Rich

Reply
0 Kudos