我发现ASP.NET的一个问题,我知道至少已经让另外一个人难过了.我们试图使用HttpModule来处理Web应用程序的通配符请求.生成的url是动态的,可能长达数百个字符.不幸的是,aspnet_isapi.dll文件中似乎存在一个限制,它将url中路径的长度限制为MAX_PATH,其中硬编码为260个字符.
有没有其他人遇到这个并找到了解决这个限制的方法?查询字符串参数不是一个选项.
谢谢,格雷格巴拉德
我正在尝试重定向到视图并继续在问题标题中发布错误.
在断点测试期间,通过代码iv的第一位的代码放在设置消息和设置异常之下.在返回重定向后继续显示下一页显示如下.

向ErrorController和错误模型添加断点我发现代码永远不会到达那里.
我想要发布的视图是一个错误页面.这是代码,以帮助您看到问题.
RedirectToAction:
string message;
message = "An error has occured during the communication to lightstone, this is likely a timeout issue and could be the result of a bad connection. Please go back and try again.";
return RedirectToAction("Error", "Error", new { ex = ex.ToString(), message = message});
Run Code Online (Sandbox Code Playgroud)
我的ErrorController中的操作:
public ActionResult Error(string ex, string message)
{
ViewBag.Message = "Error";
return View(new ErrorModel(ex, message));
}
Run Code Online (Sandbox Code Playgroud)
我的错误模型:
namespace MvcResComm.Models
{
public class ErrorModel
{
public string ex { get; set; …Run Code Online (Sandbox Code Playgroud) 我正在使用web-api并且我已将web配置文件设置为接受6144作为url的最大长度,如下所示
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime maxUrlLength="6144"
relaxedUrlToFileSystemMapping="true"
targetFramework="4.5"/>
Run Code Online (Sandbox Code Playgroud)
当我用299个字符调用api时,一切正常,但是超过299个字符会导致错误的请求 - 无效的URL
示例网址:
http://localhost:56835/api/multibuys/10270001C1001034900|10358419P4001027620|10781772P4805004950|10781772P4805004950|10781772P4805004950|10781772P4805004950|10781772P4805004950|10781772P4805004950|10781772P4805004950|10781772P4805004950|10781772P4805004950|10781772P4805004950|10781772P4805004950|