SharePoint 2010 Visual Web Parts - Specified path, file name, or both are too long Error

Whilst trying to deploy a newly created SharePoint 2010 Visual Web Part I came across this lovely error:-

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.

It abortion pill info is a bit of a strange error as I'm not sure why having a long name would create such an error.  However the fix was quite simple for me, just make sure the fully directory name + abortion doctors project name + files are not longer than 248 characters.  A lot of people seem to put their projects in something like C:\Users\Celtic_Coder\Documents\Visual Studio 2010 which is already using up 50 character from that 248 character limit!

Comments are closed