Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

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

share|improve this answer
1  
I believe that a clarification might be necessary from my side. I have ArcGIS server 10 Installed on the Windows 2008 R2 server, but not ArcGIS Desktop. Your answer seems to suggest that it should be possible to publish a Service based on a custom tool. I am interested in how to do it. –  Devdatta Tengshe Jan 25 '12 at 14:56
    
When you install the tool, you need to follow the outline I gave regarding the InvokeEsriRegAsm –  Hairy Jan 25 '12 at 15:38
add comment
up vote 0 down vote accepted

The solution in the short term is to register the custom dll on the server with the codebase switch; i.e. Use the following syntax at the command path:

regasm ..[path to dll] /codebase

In the Long term, it is not a wise decision to continue with a custom geoprocessing tool, since god alone knows whether this will work with ArcGIS 10.1.

I'll be moving towards a custom SOE, to process my data on the server.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.