C# HttpContext.Current.Error.InnerException始终返回空值

C# HttpContext.Current.Error.InnerException始终返回空值,c#,asp.net,C#,Asp.net,HttpContext.Current.Error.InnerException始终返回空值,但我在HttpContext.Current.Error和Server.GetLastError()中获取值 我的web.config文件是 <customErrors mode="RemoteOnly" defaultRedirect="~/Error.aspx" redirectMode="ResponseRewrite" /> 可能只是因为没有内部异常 描述导致当前异常的错误的异常

HttpContext.Current.Error.InnerException
始终返回空值,但我在
HttpContext.Current.Error
Server.GetLastError()
中获取值

我的web.config文件是

 <customErrors mode="RemoteOnly" defaultRedirect="~/Error.aspx" redirectMode="ResponseRewrite" />

可能只是因为没有内部异常

描述导致当前异常的错误的异常实例。InnerException属性返回与传递到构造函数中的值相同的值,如果未向构造函数提供内部异常值,则返回null引用(在Visual Basic中为Nothing)


调用
Exception.GetBaseException()