Using Geoprocessing API in stand-alone C# app

1190
3
06-06-2017 01:01 PM
JohnSelkirk
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)
0 Kudos
3 Replies
CharlesMacleod
Esri Regular Contributor

This is not supported.

0 Kudos
JohnSelkirk
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.

0 Kudos
CharlesMacleod
Esri Regular 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

0 Kudos