Sharing a custom geoprocessing function tool built in .NET or C++ is the same as sharing any other geoprocessing tool except that the function tool must be registered first. Of the following steps, the first one is the preparatory stage. Other steps elaborate the process.
Create a custom
geoprocessing function tool.
Creating a custom tool requires implementing IGPFunction2 and IGPFunctionFactory interfaces in a class library application. The output of the application is a dynamic link library (DLL). The Custom geoprocessing function tools topic in the .NET SDK help provides detailed information and examples.
The custom function tool does not automatically become part of ArcGIS. To make that happen, complete a custom registration of the DLL.
Once the DLL is registered, the tool can be used like any other geoprocessing tool. It can be shared as a geoprocessing package or published and consumed as a geoprocessing service.
Use the ESRIRegAsm utility as described in steps 3 and 4 to register the DLL.
- Test the custom geoprocessing tool.
To reiterate, the DLL of the custom tool must be registered on the machine that will be used to package or publish the tool.
- Make sure the tool runs successfully on any ArcGIS application. To test the tool, add it to a custom toolbox. Follow the desktop topic Adding tools to a toolbox if you need detailed steps.
- Document the tool. Refer to A quick tour of documenting tools and toolboxes for the steps. However, to document a DLL-based custom tool, you need to enable Item Description first. Consult Enable ArcMap to create documentation for custom geoprocessing tools for details.
- Run the tool in ArcMap to produce a result in the Results window. Examine the result and the output to verify this is a valid result. The result will be used to package or publish the tool.
- Share the tool as a geoprocessing package.
- Create a package from the result. Review A quick tour of creating a geoprocessing package for more information.
- As the tool's DLL is not bundled with the package, you must share the DLL separately along with instructions for how to register it.
- Register the DLL on the machine before using the package on that machine. To register the DLL for a 32-bit ArcGIS product (for example, ArcGIS Desktop) use the ESRIRegAsm utility located in the C:\Program Files (x86)\Common Files\ArcGIS\bin folder.
- Share the tool in a geoprocessing service.
- Make sure the DLL is registered on the machine hosting ArcGIS Server. The custom registration on the server machine must be done before any attempt to publish the tool from a client.
- Register the DLL for ArcGIS Server, a 64-bit product, using the ESRIRegAsm utility located in the C:\Program Files\Common Files\ArcGIS\bin folder.
- The result created in step 2c above can be published as a geoprocessing service from the machine where the result was created. It is important to remember that the DLL must also be registered on the machine from which you want to publish the result.
- To publish the tool as a service, refer to A quick tour of publishing a geoprocessing service for more information.