Geoprocessing.MakeValueArray throws System.Nullexception console application

404
1
06-30-2020 01:47 AM
PiyushJain
New Contributor

Geoprocessing.MakeValueArray throws System.Nullexception while using in console application. Is ArcGIS.Desktop.Core assembly supported in Console application and if yes what could be the issue it throws exception?

string inRas1 = @"C:\Sample1.tif";
string inRas2 = @"C:\Sample2.tif";

string maExpression = String.Format("Con((‘{0}’ > 30), ‘{1}’)", inRas1, inRas2);
string outRaster = @"C:\output.tif";
var valueArray = Geoprocessing.MakeValueArray(maExpression,outRaster);
var gpresult = await Geoprocessing.ExecuteToolAsync("RasterCalculator_sa", valueArray);

Tags (1)
0 Kudos
1 Reply
UmaHarano
Esri Regular Contributor

Hi Piyush

Only  ArcGIS.CoreHost and ArcGIS.Core assemblies are supported with a console application in ArcGIS Pro.

Thanks!

Uma

0 Kudos