Thursday, December 1, 2011

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters.

Hello Again !

We usually get this common error when trying to deploy a package containing files of length greater than 260 characters. VS 2010 showed this error in feature.

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters.

At first glance, the obvious solution which we feel is to reduce the file names in the solution. I tried the following approaches:

1. Reduced the file names in my solution especially the SharePoint Mapped Layouts Folder.
2. Changed the VS 2010 Project directory from C:\Users\saiabhilash\Documents\Visual Studio 2010\Projects to C:\MyProjects but got the same error !

OK! The resolution to this problem is to change the Deployment Path for the Feature. Double Click on the Feature and click F4 by selecting the feature. By Default, the Deployment Path for a features looks like this

"$SharePoint.Project.FileNameWithoutExtension$_$SharePoint.Feature.FileNameWithoutExtension$"

We have deleted the First Portion of this string and modified the path as

"CompanyName_$SharePoint.Feature.FileNameWithoutExtension$"













With this change, we were able to get rid of the above error :)

1 comment:

  1. Thank you soo much - instead of wasting an hour resolving this issue I was able to resolve this error in a matter of minutes.

    ReplyDelete