4 Replies Latest reply: Feb 25, 2011 4:28 AM by mwoolley

    Add Custom GP Tool to Toolbox

    mwoolley
      There is a thread over in the archived forums that got right to the edge of addressing my problem:
      http://forums.esri.com/thread.asp?t=274589&f=1170&c=93

      I'm working in an ArcGIS 9.3.1 environment.

      I have a Custom Geoprocessing Tool developed in VB.NET / Visual Studio 2005. It runs great in Desktop applications on the machine it was compiled on. I'm having trouble getting the map, toolbox, models and DLL containing the custom tool to all play nice on our ArcGIS Server. I've copyed the compiled DLL and related files to the server and registered the DLL using Regasm.exe. I do not have ArcGIS Desktop tools on the Server. Is there a special folder the custom tool needs to be placed in?

      When I run a very simple model that only contains the custom tool I get the error:
      000816 : The tool is not valid.

      The archived thread ended tantalizingly with Matt Rodriguez stating: "I made this work. I had to ask ESRI developers for help because there isn't really documentation on how to do this."

      Mark Woolley
      GIS Programmer/Analyst
      Ontario Government - LRC
        • Re: Add Custom GP Tool to Toolbox
          mwoolley
          Perhaps my problem comes down to this: How do I diagnose whether the problem is internal to the tool (the DLL's programming) or a problem with calling the tool (something to do with the toolbox/model/registry process).

          Since the tools works fine on the desktop and since the toolbox I've published to the server had the custom tool added before it went on the server (when the tool was added it would have used the local copy of the DLL) I suspect it's the latter. If so does anybody have a recipe for implementing custom tool DLLs on ArcGIS server and referencing them from a toolbox/model?
          • Re: Add Custom GP Tool to Toolbox
            mwoolley
            I learned that when registering the DLL on the SOC you need to include the /codebase switch of the regasm.exe utility. The DLL must also be registered on the workstation where you authoring the Toolboxes and Models so that it appears in the list of available tools when you are creating the Toolbox and using it in the models.

            The error "000816 : The tool is not valid" went away - seems that was about the registration problem. The new error from GPServerSync.GetReturnMessages is "Invalid return value: " which is probably internal code issues within the DLL that are ArcGIS Server specific (worked fine on Desktop) likely around gp.scratchworkspace.
            • Re: Add Custom GP Tool to Toolbox
              rfortin22
              Mark,

              I have a similar problem on Windows Server 2008 64-bit.  What do mean exactly when you say "registering the DLL on the SOC"?  I tried registering using the 32-bit version of regasm but still the same message.  Could it be the user account it needs to be registered in?

              Thanks for your help!

              Robert
              • Re: Add Custom GP Tool to Toolbox
                mwoolley
                Mark,

                I have a similar problem on Windows Server 2008 64-bit.  What do mean exactly when you say "registering the DLL on the SOC"?  I tried registering using the 32-bit version of regasm but still the same message.  Could it be the user account it needs to be registered in?

                Thanks for your help!

                Robert


                "Registering the DLL" was meant to mean: use the regasm utility with it's /codebase switch to add an entry to the computers registry for the DLL. "On the SOC" was a way of referring to the computer(s) in question. If you have multiple computers configured to be SOCs in your ArcGIS Server environment you would have to (presumably as an administrator, in order the update the registry) execute the same regasm command on each machine.