'the server was unable to create your template' error when saving Sharepoint Designer workflow as a template

This an error I got while developing reusable Sharepoint Designer workflows for Sharepoint 2010. What I was trying to do was to create a new reusable SPD workflow and publish it globally to the Site Collection, then I would try to export it as a WSP template and import it on different sites. I had already succesfully exported other workflows with no issues however with this one I run into a new error. When clicking the "Save as template" button, Sharepoint Designer would return the error "the server was unable to create your template".

Unfortunately Sharepoint Designer don't provide a more detailed error description so we have to refer to the Sharepoint Logs to see what's going on, and there I found the following error:


w3wp.exe (0x0C08) 0x103C SharePoint Foundation General 8h2i Monitorable SPSolutionExporter: System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. at System.IO.Path.SafeSetStackPointerValue(Char* buffer, Int32 index, Char value) at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck) at System.IO.Path.GetFullPathInternal(String path) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOption... 2164e9ba-98e7-47a7-b632-f58fa7a481eb

It turns out this time the log provided some really useful information about the error. If we pay attention we'll notice it's actually complaining about the size of the url of the WSP template that he is trying to save in the Solutions gallery of the Site Collection. The fix in this case was easy: I renamed the workflow with a shorter name to make sure it was below the 260 character limit! So always remember to take the url limitation into account when working with Sharepoint Designer :-)


Created on 11/05/2011



Get Microsoft Silverlight

Get Microsoft Silverlight