I have a custom GP function in ArcGIS 10 written in C#. When the tool is run it takes ArcGIS about 5 minutes to close (as in the application closes but in Task manager ArcMap.exe and ArcSOCP.exe are still running). When closed ArcMap.exe will increase memory too about 170 - 250 MB.

To ensure it wasn't my code I created a blank GP Function with no code in the Execute function and return and empty paramarray value. Ran the tool and ArcMap still took ages too close.

I then opened ArcMap again and launched the tool but this time pressed cancel instead of go. ArcMap closed fine.

So as soon the tool enters the execute method it seems to then take ages to close when the Execute method finishes.

If I run one of the out of the box GP tools ArcMap closes fine.

Anyone encountered the same problem?

  • Does this happen with the Calculate Area sample tool too? Does it only happen when running from visual studio in debug mode? – Kirk Kuykendall Dec 20 '11 at 23:01
  • Hi Kirk - I've just done the same with the Calculate area tool. The same issue happens with this tool. It occurs whether in VS or not. – Rob Dec 22 '11 at 10:15

I think that the problem lies in the code that is being used. I have created a couple of custom geoprocessing tools for Arcgis 10, and I do not see the problem that you have mentioned. As Kirk has mentioned, does the problem occur when running the Sample tool?

I would check the code, to see if any reference is left open, and also try to see if an extra handles are open. This can be done by using SysInternal's Process Moniter tool

  • I tried Procman but it didn't highlight anything. When I close ArcMap it shows 4 ThreadExit events then just stops. No records are entered. Then after a few minutes, activity starts back up in procman with a CreateFile on C:\Program Files (x86)\ArcGIS\Desktop10.0\Bin\AccessWorkspaceFactory.dll – Rob Dec 22 '11 at 10:38

I was running this through Citrix, didn't seem to have the issue on my own machine. Couldn't find a solution in the end so implemented a different way of doing what I needed to do.

Not the answer you're looking for? Browse other questions tagged or ask your own question.