I'm having a related issue using the CopyFeatures method in an addin. I have the Geoprocessor set to GP.OverwriteOutput = true; and it works (some of the time). The issue appears to be isolated to how geodatabases are being handled for the output feature class. I'm trying to capture the result so that I can work with it using IGeoProcessorResult2 result = (IGeoProcessorResult2)RunTool(GP, copyFeatures, null);
Scenario 1. Shapefiles: not a problem
Scenario 2. Geodatabase (personal or file, same issue):
Pass * if the feature class doesn't already exist then it gets created fine.
Pass * if the specifed output has the same path as an existing feature class then it overwrites it fine
Pass * if the output is specified to the root of the geodatabase and there is an existing feature class in a feature dataset then it runs fine
Failed * if the output is to a feature dataset and there is an existing feature class at the root or in another feature dataset then it fails (result = null)
Also, I have to remove any spaces in the output feature class name (again isolated to geodatabases, shapefiles work fine) or CopyFeatures fails. Spaces in the path (i.e. feature dataset name has a space) do not cause an error.
I'm running ArcGIS 10.