繁体   English   中英

无效的URI:无法确定URI的格式异常

[英]Invalid URI: The format of the URI could not be determined Exception

在我的asp.net c#Web应用程序中,无法找到代码中的确切位置,引发了此异常(无效的URI:无法确定URI的格式。)。 出现异常的URL的格式如下

http://somedomain.com/sepsisvte/sepsis.aspx?4040431page=2

如果问题与URL的结构有关,则存在如下所示的URL,我根本不会遇到任何异常

http://somedomain.com/sepsisvte/sepsis.aspx?4020894page=2 http://somedomain.com/sepsisvte/sepsis.aspx?4020894page=3

这是一个相当大的应用程序,而且真的很难找到错误的根源。 有任何想法吗?

stacktrace如下

[UriFormatException:无效的URI:无法确定URI的格式。] System.Uri.CreateThis(字符串uri,布尔值dontEscape,UriKind uriKind)+5462488 System.Uri..ctor(字符串uriString)+20
umbraco.presentation.requestModule.rewrite404Url(字符串url,字符串查询字符串,布尔值returnQuery)+265
umbraco.presentation.requestModule.Application_BeginRequest(对象发送者,EventArgs e)+237
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+68 System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,布尔值,已完成,同步)+75

这是因为您的网址包含此“?404”。 Umbraco会在每个URL中搜索该文本,如果存在,则会重写该URL。 在此处检查源代码: https ://searchcode.com/codesearch/view/28576630/,搜索此方法:rewrite404Url。

解决方案之一是尝试为您的查询字符串键添加下划线前缀。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM