I am struggling with an issue using the `geoprocessing.ExecuteToolAsync` while having feature class in a memory Geodatabase.
The Result after "FeatureClassToFeatureClass" executed is declared with `IsFailed = true` but no errors are displayed (listed in ErrorMessages)
Below is a POC
// "in_memory" or "memory" - both fail
var parameters = Geoprocessing.MakeValueArray("memory\\" + _targetFeatureClass, "C:\SomeOutputDir", "OutputShapeFile");
var environment = Geoprocessing.MakeEnvironmentArray(overwriteoutput: true, workspace: "in_memory", qualifiedFieldNames: false);
var result = await Geoprocessing.ExecuteToolAsync("FeatureClassToFeatureClass", parameters, environment, null, null, GPExecuteToolFlags.None);
A workaround is to add the FeatureClass as FeatureLayer and use it as parameter 1. E.g.
// WORKING
var layer = ArcGIS.Desktop.Mapping.LayerFactory.Instance.CreateFeatureLayer(_targetFeatureClass, ArcGIS.Desktop.Mapping.MapView.Active.Map);
// Use the "layer" variable instead
var parameters = Geoprocessing.MakeValueArray(layer, shapeFileOutputDir, shapeFileOutputName);
var environment = Geoprocessing.MakeEnvironmentArray(overwriteoutput: true, qualifiedFieldNames: false);
var result = await Geoprocessing.ExecuteToolAsync("FeatureClassToFeatureClass", parameters, environment, null, null, GPExecuteToolFlags.AddToHistory);
Is this intented to be the correct way when using memory feature classes?