AnsweredAssumed Answered

How to get published GP Service (custom c# tool) to run twice??

Question asked by mark3773 on Mar 16, 2016
Latest reply on Mar 16, 2016 by Dan_Patterson

I have a custom GP tool created that works fine in desktop, i can publish it to server successfully, and i can run it from the server endpoint in desktop and even call it from a web application. The problem is however that on the second execution the tool fails. The error message is:


This is one of the tool output parameters.

Invalid return value: c:\arcgisserver\directories\arcgisjobs\solveroute_gpserver\j206d69d70deb45f48030116282263aa5\scratch\scratch.gdb\SHORTEST

the output is defined as:


                IGPParameterEdit3 outputParameter = new GPParameterClass();
                outputParameter.DataType = new GPFeatureRecordSetLayerTypeClass();
                outputParameter.Direction = esriGPParameterDirection.esriGPParameterDirectionOutput;
                outputParameter.DisplayName = "Shortest Route Results";
                outputParameter.Name = "shortest_routes";
                outputParameter.ParameterType = esriGPParameterType.esriGPParameterTypeDerived;


I can see the job id on the path changes on each invocation but so not sure why its failing. Next call gives:

Invalid return value: c:\arcgisserver\directories\arcgisjobs\solveroute_gpserver\jb73331a1e1324bc2b44b2c6d98baed7a\scratch\scratch.gdb\SHORTEST

If I restart server it all works again for one execution.

Anyone have any tips on what you need to do to make this work?