When using a valid Python script that references a *.style file published as a geoprocessing service in ArcGIS for Server 10.1, the script will fail with an error message that the *.style file reference in the script is missing or does not exist.
Last Published: August 25, 2014ArcGIS for Server
Bug ID Number
NIM083777
Submitted
August 14, 2012
Last Modified
April 2, 2025
Applies to
ArcGIS for Server
Version found
10.1
Status
Known Limit
After review by the development team, it has been determined that this issue is related to a known limitation with the software that lies outside of Esri's control. The issue's Additional Information section may contain further explanation.
Additional Information
must use a .serverStyle file with ArcGIS Server
Workaround
To make serverStyle files, you can use the utility at: "<a href="file:C:/Program" target="_blank">C:\Program</a> Files (x86)\ArcGIS\Desktop10.1\bin\MakeServerStyleSet.exe"You can use a .serverStyle file both in Desktop and ArcGIS Server. So the code in your script just uses a single file.Or, if you want to maintain 2 files (.style and .serverStyle) you can use the following bit of code which should work in both Desktop and Server, calling the most appropriate file. Keep in mind though, that this code wont consolidate and move both files during the publishing process and I'd suggest using data store to register the folder with the style files.if arcpy.ProductInfo() == 'ArcServer': ext = '.serverstyle'else: ext = '.style' stylefile = os.path.join(‘C:/temp’, "legend" + ext)ListStyleItems help topic: <a href="http://resources.arcgis.com/en/help/main/10.1/index.html#/ListStyleItems/00s300000074000000/" target="_blank">http://resources.arcgis.com/en/help/main/10.1/index.html#/ListStyleItems/00s300000074000000/</a>