[GIS] Is it possible to publish a geoprocessing services that uses a custom gptool on ArcGIS Server 10

arcgis-serverdll

I have developed a custom GP tool in C# which does a bunch of processing on a given layer.

It works great in ArcMap on all machines that I have deployed it to. I created a model which uses this tool and want to publish it as a geoprocessing services. It worked without any problems on our testing machine (This was probably because the testing machine has Arcgis Desktop, as well as Server, & I published the service using the ArcCatalog on that machine itself).

Today I had to deploy it to our production server. This does not have ArcGIS Desktop. So I registered the DLL using ESRIRegasm on the server. But No matter what I do, I can't get a Geoprocessing service running using the custom tool. I tried placing the toolbox on the server and publishing it. It did get published, but when I conusmed it from ArcMAp, I got the error "ERROR 000816: The tool is not valid".

Over on ESRI forums, there have been just a few threads about this issue; And the only one which was marked as resolved, talked of registering the dll using the /codebase switch. (this was with ArcGIS 9.3.1)

Has anyone succesfully deployed a custom geoprocessing tool to a server, with ArcGIS server but not ArcGIS desktop?

Best Answer

You can't deploy this without access to the GAC libraries, which are installed as part of ArcGIS Desktop or ArcGIS Server for .NET; there is no way of deploying an ArcObjects toolkit without first installing the above.

We deployed it with all it's library files contained in the deployment. This worked, but was completely at odds with ESRI licensing.

So in short, you can't do it without AGD or AGS 10 installed.

One other thing to note, regardless, and a major difference betwen 9.3.1 and 10, is that Once your tool model runs correctly, the tool needs to registered with the ESRI component categories before it can run within an ArcGIS Server 10 instance.

We have done this registration by creating a C# .Net setup project within our base C# .NET solution. This project has changed completely as a result of differences in component category registration functionality between ArcGIS 9.3.1 and ArcGIS 10 products.

Esri recommend placing common component category registration functionality in a separate C# .NET project that produces a DLL. This common DLL is then included within each setup project that needs it.

nerdy: In ArcGIS 9 you used to register custom components with the ESRI component categories using the Windows registry. That's all gone and you do it via the 'InvokeEsriRegAsm'. It's the ESRI way of hooking the assembly in with COM without polluting the registry

E.g. Example of what I mean : ESRIRegAsmtility

Related Question