Issue regarding the file path length

May 27, 2009 at 2:11 PM


I have integrated the sandcastle with the build script. Now when I run the sandcastle, I got one exception in BuildAssemler (but not sure if it is build assembler, just found by the messages in build log file).

The exceprion message is:

Unhandled Exception: 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.NormalizePath(String path, Boolean fullCheck)

at System.IO.Path.GetDirectoryName(String path)

at Microsoft.Ddue.Tools.SaveComponent.Apply(XmlDocument document, String key)

at Microsoft.Ddue.Tools.BuildAssembler.Apply(IEnumerable`1 topics)

at Microsoft.Ddue.Tools.BuildAssembler.Apply(String manifestFile)

at Microsoft.Ddue.Tools.BuildAssemblerConsole.Main(String[] args)


What may be the issue, and is there any resolution for this

May 27, 2009 at 8:18 PM
Edited May 27, 2009 at 8:22 PM

If you are using AddFriendlyFilenames.xsl to add friendly names to the topics, you can try switching to AddGuidFilenames.xsl to use GUID naming for the topics.  If you are using the Sandcastle Help File Builder, you can do this using the NamingMethod project property.  The other option is to move the project to a folder closer to the root so that the combined fully qualified path length plus filename lengths don't exceed the maximum.  If you are using SHFB and don't want to move the project you can set the WorkingPath project property to a location with a shorter path.