I have an ArcMap Add-In that completes various geoprocessing steps, including Dissolve (using ESRI.ArcGIS.DataManagementTools.Dissolve). This tool worked at 10.0, but I just upgraded to 10.1 SP1 and it no longer works. I have run the tool on the same feature class in 10.0 and 10.1 and it worked in 10.0 but does not work in 10.1 SP1.

I'm attempting to dissolve on 2 fields, single part, in case that's relevant.

I can still complete the dissolve manually inside of ArcMap, but every time I try to run it programmatically, it crashes with the ever-helpful "Error HRESULT E_FAIL has been returned from a call to a COM component."

Upgrading to 10.2 is not an option because the rest of my organization won't be upgrading to 10.2 for at least another year.

Has anyone else encountered this? Any suggestions on how to solve this problem? Knowledge of something that changed at 10.1 that would require some extra conditions in order for dissolve to run correctly...?

  • You say this same add-in performs multiple steps, so I guess the next obvious question to me would be, do the other tools in that add-in still work? If they do, I don't know (not my area of expertise), but if not, it may be an issue with the add-in as a whole working in ArcMap 10.1. Just a thought.
    – John
    Apr 24, 2014 at 15:20
  • There is either a bug in your Add-In or esri's code. I like to assume my Add-In code is perfect, and try to create the simplest possible irrefutable example to show esri how broken their code is. Usually this points me to my error. Apr 24, 2014 at 15:32
  • 1
    You should be able to get an error code somehow from that HRESULT E-FAIL message, which might tell you a bit more about what the issue is. If you can't find the problem, I would consider trying an uninstall of the service pack because it seems to cause a lot of issues (for me anyway).
    – pvdev
    Apr 24, 2014 at 15:51
  • John, the same add-in executes most other geoprocessing functions properly (e.g., Intersect) - though it is also failing on Erase. thehealingprocess, E_FAIL is a generic error as far as I can tell, the error code on it translates to 'unspecified error' if I run it through the error lookup. I'll try uninstalling SP1 to see, but unfortunately my users have to have SP1 as it fixes an error in their address locator at 10.1 so they can't downgrade, so that can't be a long-term solution.
    – BeckyZ
    Apr 24, 2014 at 20:38
  • Update: I uninstalled SP1 and am still getting the same error.
    – BeckyZ
    Apr 24, 2014 at 21:48

3 Answers 3


Thanks to prompting by thehealingprocess, I did investigate a little more and the GP messages indicate the proper error is actually "Workspace or data source is read only"...which a bunch of others have encountered here as a bug at 10.1: http://forums.arcgis.com/threads/80394-Error-“Workspace-or-data-source-is-read-only.”-from-file-geodatabases. Now to see if I can implement one of those changes to fix it...

Didn't think to check the messages in the first instance since the GP ran just fine in ArcMap, just not in code.

UPDATE and FINAL ANSWER: I contacted ESRI support and the manifestation I was seeing - the code didn't work but executing manually in ArcMap did - prompted him to have me try ExecuteAsync instead of Execute to try to avoid conflicts with background processes. Apparently ExecuteAsync is effectively what ArcMap uses. When I did this, the tool completed successfully. So, there is a bug (he referenced NIM 094612), but the workaround is to use ExecuteAsync rather than Execute. Hope this helps someone else!

  • interesting! I wonder if using the "disable background processing" option would have had the same effect? Apr 29, 2014 at 17:26
  • I wondered the same myself! I couldn't figure out how to set that programmatically, but I did try setting it in the geoprocessing options within ArcMap and it didn't help. If you know how to set it programmatically please let me know and I'll try it out.
    – BeckyZ
    Apr 29, 2014 at 20:58
  • An arcpy.env.EbackgroundProcessing setting exists. Setting that to False might disable background processing but I cannot find any documentation for it. For me dissolve fails to complete in a non-predictable way. If I run the same same dissolve over and over it will fail about 1 time in 20, it will hang for about a day and then crash. It is infuriating.
    – Alexander
    Apr 19, 2016 at 6:48

Do you have a 32-bit OS? There is a bug with Dissolve in 10.1 SP1 and 32-bit OS: : NIM090106 - In ArcMap, the Dissolve tool (with single part option) fails or creates extra features for certain datasets on a 32-bit operating system. It's solved in 10.2.1. 10.1 and 10.2 geodatabases are backward and forward compatible, if that's what worries you about upgrading.

  • Thanks for your answer; I am on a 64-bit OS so I don't think this applies.
    – BeckyZ
    Apr 24, 2014 at 20:26

The add-in source code needs to be recompiled for 10.1. There are a number of subtle differences in ArcObject libraries (and their location after upgrading to 10.1) that may need to be addressed. You are seeing a common generic error but it is impossible to say exactly what is going on without debugging the add-in line by line (not difficult if you have access to the add-in source code).

There is also a chance that the add-in is using a custom tool/toolbox when it calls the geoprocessing task in which case the path to that particular tool could be hard-coded and the tool/toolbox is missing or exists in a different location after upgrading to ArcGIS 10.1. (I am only guessing because that is what I do - I create my own toolbox and tools so I can control the parameters programmatically) If the add-in was in fact calling a tool stored in a custom toolbox in the default directory "C:\Users\USERNAME\AppData\Roaming\ESRI\Desktop10.0" for example, it will crash. If the tool is missing, the IGeoProcessor object will be set to a path that does not exist and it could raise the error you mention and crash.

  • Thanks for your advice; however, I already recompiled with the 10.1 libraries and am using the standard tool in the standard toolbox.
    – BeckyZ
    Apr 28, 2014 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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