Good afternoon,
We are running this code in an ArcGIS Pro Add -In and it fails

private static async Task<IGPResult> MakeXYEventLayer(string adorTablePathName, string layerName)
{
var parameters = Geoprocessing.MakeValueArray(adorTablePathName, "xcoordinate", "ycoordinate", layerName, 2868);
return await Geoprocessing.ExecuteToolAsync("MakeXYEventLayer_management", parameters);
}
However, If I run the GeoProcessing tool in ArcGIS Pro the tool works but not in code.
Any help would be appreciated.
Thank you
Mele