[GIS] Why would Dissolve stop working in ArcGIS for Desktop

add-inarcgis-10.1arcgis-desktopdissolve

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…?

Best Answer

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!

Related Question