Asp.net mvc ASP.NETMVC中的414(请求uri太长)仅在设备上-51度设备检测?

Asp.net mvc ASP.NETMVC中的414(请求uri太长)仅在设备上-51度设备检测?,asp.net-mvc,mobile,51degrees,Asp.net Mvc,Mobile,51degrees,我依靠@Request.Browser.IsMobileDevice来区分ASP.NET MVC网站的访问者 我正在使用51度库。但是,当从移动设备浏览某些图像时,出现错误414(请求uri太长)。在个人电脑上,这种情况不会发生,只是在手机上 堆栈在以下位置显示PathTooLongException: à System.IO.PathHelper.GetFullPathName() à System.IO.Path.NormalizePath(String path, Boolea

我依靠
@Request.Browser.IsMobileDevice
来区分ASP.NET MVC网站的访问者

我正在使用
51度
库。但是,当从移动设备浏览某些图像时,出现错误
414(请求uri太长)
。在个人电脑上,这种情况不会发生,只是在手机上

堆栈在以下位置显示
PathTooLongException

   à System.IO.PathHelper.GetFullPathName()
   à System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   à System.IO.Path.GetFullPathInternal(String path)
   à System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)
   à System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)
   à System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
   à System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path)
   à System.Web.InternalSecurityPermissions.PathDiscovery(String path)
   à System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping)
   à System.Web.HttpServerUtility.MapPath(String path)
   à FiftyOne.Foundation.Mobile.Detection.Feature.ImageOptimiser.OptimisedImageResponse(HttpContext context)
   à FiftyOne.Foundation.Mobile.Detection.DetectorModule.OnPostAuthorizeRequest(Object sender, EventArgs e)
   à System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   à System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
似乎
FiftyOne
在这个堆栈中。当我卸载51度时,它会恢复工作。但是,我需要51度才能使移动设备与当前设备兼容


是否缺少任何参数?51degrees是
.net3.1.9.3版

几天前我遇到过同样的问题。我们已经使用51度解决方案很多年了,但现在在移动设备上遇到了414问题


我最后使用了“”。易于实现,并提供从WURFL数据存储库读取所需的所有功能。现在我不再收到414个错误。

如果您发现自己处于类似情况,您可以:

  • 转到51度.config文件
  • 打开它
  • 向下滚动,直到找到图像优化部分
  • 启用设置为false
  • 保存并重新启动应用程序

  • 这是解决414问题的另一种方法。

    看起来像是
    ImageOptimizer。OptimizeImage Response
    试图将虚拟路径映射到物理磁盘路径。完整文件路径的最大长度仅为260个字符。我猜库已经创建了一条路径,该路径太长,系统无法处理。我刚刚遇到了这个问题。你把它弄好了吗?