Solved! Go to Solution.
Taking off STAThread is not the solution, it will seriously impact the application to be thread unstable and impact the performance a lot. The solution to this is to properly execute the GeoProcessing tools. Within this module, assign NULLs and release all objects properly. I had this problem for awhile, and this resolved my issue with running GeoProcessing tools within my Console Application.
public static void RunTool(Geoprocessor geoprocessor, IGPProcess process, ITrackCancel TC)
{
// Set the overwrite output option to true
geoprocessor.ClearMessages();
geoprocessor.OverwriteOutput = true;
// Execute the tool
try
{
geoprocessor.Execute(process, null);
ReturnMessages(geoprocessor);
geoprocessor = null;
process = null;
ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject(geoprocessor);
ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject(process);
}
catch (Exception err)
{
ReturnMessages(geoprocessor);
}
}