I am trying to create an empty feature class in a file geodatabase, but it's not working. The geoprocessing tool doesn't provide a specific error message. When I run the tool on a folder, it creates an empty shapefile without any issues. Here is my code:
string path = analysis.Path + "\\CVAnalysis.gdb"; // This doesn't work. The CVAnalysis.gdb exists, and I have no problem creating a feature class when running the geoprocessing tool manually in ArcGIS Pro.
string path = analysis.Path; // This works and output a shapefile.
var parameters = Geoprocessing.MakeValueArray(
path,
"NewLayer",
"Polygon"
);
string toolName = "management.CreateFeatureclass";
var result = await Geoprocessing.ExecuteToolAsync(toolName, parameters, null, null, null);
if (result.IsFailed)
{
foreach (var message in result.Messages)
{
MessageBox.Show(message.Text); // There is no message in the error
}
}
else
{
System.Diagnostics.Debug.WriteLine("Feature class created successfully.");
}