Using Geoprocessing API in stand-alone C# app

635
3
06-06-2017 01:01 PM
Highlighted
New Contributor III

Hi,

Is it possible to run Geoprocessing tools from a stand-alone application?

Something like this: 

var param_values = Geoprocessing.MakeValueArray(@"C:\temp\mmpk.aprx", @"c:\temp\mmpk.mmpk");

var gp_result = await Geoprocessing.ExecuteToolAsync("CreateMobileMapPackage_management", param_values);

The reason I ask is that when the 1st line is called I get a null reference exception. It's like it's not initialized properly.

I have followed the steps in ProConcepts CoreHost · Esri/arcgis-pro-sdk Wiki · GitHub  and it does Host.Initialize() properly.

Anyone else tried doing this?

John.

Tags (2)
Reply
0 Kudos
3 Replies
Highlighted
Esri Contributor

This is not supported.

Reply
0 Kudos
Highlighted
New Contributor III

Hi,

So is there any approach (running a python script?) that accomplishes the same goal?

The goal being create a Mobile Map Package from one or more ArcGIS Pro projects?

John.

Reply
0 Kudos
Highlighted
Esri Contributor

That is definitely the way to go. Python is outside of my wheelhouse I'm afraid. There is a start guide here: http://pro.arcgis.com/en/pro-app/arcpy/get-started/installing-python-for-arcgis-pro.htm 

You may find this forum helpful for python expertise: https://community.esri.com/community/developers/gis-developers/python

Reply
0 Kudos