U4-7319 - System.IO.PathTooLongException calling surface controller action

Created by George Tsiagis 27 Oct 2015, 19:04:32 Updated by Claus Jensen 16 Aug 2016, 11:01:48

I am calling an Html.Action inside a surface controller. When the page name is 30 unicode characters (all chars greek) or more in length the following error occurs. No error if using english characters or remove Html.action command

[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.] System.IO.PathHelper.GetFullPathName() +12197395 System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths) +1346 System.IO.Path.GetFullPathInternal(String path) +50 System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath) +99 System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath) +293 System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList) +109 System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path) +63 System.Web.InternalSecurityPermissions.PathDiscovery(String path) +32 System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping) +149 System.Web.HttpRequest.MapPath(VirtualPath virtualPath) +33 System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) +43 System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +29 System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +24 System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) +463 System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues) +83 System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName) +11

Comments

Paul Bowen 16 Aug 2016, 04:53:22

I've been having a lot of issues today with regards to new multi-lingual site I'm working on. It's in fact an upgrade of an existing live site and has a lot of Chinese and Japanese content that works perfectly on the current site which is Umbraco 4.7.11.

However when trying to open up those pages on Umbraco 7.4.3 I'm getting PathTooLongException errors all over the place. Reducing the length of the URL was turning into a real problem because they didn't actually have to be that long to cause an issue.

However, I managed to find a solution. My pages now work with the following in the web.config.

<httpRuntime maxUrlLength="1000" relaxedUrlToFileSystemMapping="true" />

Hope this helps you.


Claus Jensen 16 Aug 2016, 11:01:48

Marked this as normal priority due to the possible workaround posted for the issue. Thanks @paul@selectux.com :)


Priority: Normal

Type: Bug

State: Submitted

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.3.0

Due in version:

Sprint:

Story Points:

Cycle: