Geoprocess code hangs on ArcGIS Server

Discussion created by jerisue on Aug 9, 2011
I wrote some code using ArcObjects to process data.  I wrote this using Desktop and it works fine there.  When I change it over to run on Server, it runs all the code then hangs in the command window.  I have released all the COM Objects, set all the variables to nothing and did a GC.Collect().  Nothing makes this code return to the command prompt. 

I started at the bottom and commented out blocks of code until it ran without hanging.  Then I went line by line to find the exact line causing the issue.  The line is "Dim gp As Geoprocessor = New Geoprocessor()" with everything after it commented out except setting the gp to nothing.  If I comment out the Dim gp line it runs without hanging.  If its uncommented, it hangs.

This is the first use of the gp in this code.  I'm running ArcGIS Desktop and Server 10 on Windows machines.

Any ideas or suggestions?