Select to view content in your preferred language

Calling custom toolbox from ArcObjects

1260
9
06-30-2020 03:00 AM
ModyBuchbinder
Esri Regular Contributor

Hi All

We have a problem with calling our toolbox from ArcObjects.

Check the attached screen shot. The toolbox exists, it was created with the same version of ArcGIS, it include one simple tool.

It all works just fine on my machine but we tested it on a few machines on the client site and it fail with the error message you see.

Anybody have any idea what is wrong?

Thanks

0 Kudos
9 Replies
nicogis
MVP Frequent Contributor

Have you background processes in ArcGIS enabled or disabled ? (see the Geoprocessing Options dialog box)

0 Kudos
ModyBuchbinder
Esri Regular Contributor

We tried both (with or without) and it does not work

0 Kudos
nicogis
MVP Frequent Contributor

If you use custom tool use:

IGeoProcessor2 IGeoProcessor2 gp = new GeoProcessor() as IGeoProcessor2;‍‍

If 'Embed Interop Types' is set to true then omit the 'Class' at the end of the type (GeoProcessorClass -> GeoProcessor() )

and check that you have target 'x86' in VS and not 'Any'

0 Kudos
FabianoFerrazza1
Occasional Contributor

Hi,

have you registered your toolbox class with EsriRegAsm.exe application on all client machines?

0 Kudos
ModyBuchbinder
Esri Regular Contributor

Hi Fabiano

What do you mean?

The code is AddIn it does not required registration and we run from VS so it register automatically everything.

Please explain

0 Kudos
FabianoFerrazza1
Occasional Contributor

Sorry, maybe i misunderstood.

Is Your Geoprocessing a Custom geoprocessing (developed with arcobjects)? Or, simply, you have an addin that "launch" a "simple" geoprocessing tool (system tool or, anyway a tool build by model builder/python)? in this last case, i musunderstood

0 Kudos
ModyBuchbinder
Esri Regular Contributor

I am running a GP tool that I wrote in Python

0 Kudos
FabianoFerrazza1
Occasional Contributor

Ok. 

Is the Custom toolbox created by code or by desktop?

Do you have any ArcGIS desktop on the client site machine to try to launch the tool? 

0 Kudos
ModyBuchbinder
Esri Regular Contributor

It is all very simple (that is why I am lost).

Everything in done on a single machine with ArcMap, VS and ArcObjects.

I created very simple Python script. Create a toolbox from it (simple toolbox not python toolbox).

I run the tool from ArcMap with no problem.

I created a VS solution trying to call the same tool and it fail.

Thanks

0 Kudos