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.

If you run into this it could be because your url is too long for the routing engine to handle by default. 

all you gotta do is find your httpruntime configuration element in your web.config and set an attribute called relaxedUrlToFileSystemMapping in it to true, like this:

 

<system.web>

<httpRuntime targetFramework=”4.5″ maxRequestLength=”512000″ relaxedUrlToFileSystemMapping=”true” />

</system.web>

 

sorted.

3 thoughts on “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.

    • Hi Alexandra,
      wow, I completely missed your comment, sorry about that! probably doesn’t matter anymore by now, but for what is worth, no, I didn’t encounter anything. Would be good to know if you had any issues.
      sorry again for the delay!
      all the best,
      Matheus Guimaraes

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s