0

我已经建立了一个方案,我的客户网站(一个 ASP.NET 2.0 应用程序)上的任何异常都会通过电子邮件发送给我。几乎每天晚上(通常发生在晚上)我都会收到如下错误:

Error: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

Stack Trace:
   at carart.products.Page_Error(Object sender, EventArgs e)
   at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
   at System.Web.UI.TemplateControl.OnError(EventArgs e)
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.products_aspx.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

最后一个位置是 Page_Error,因为我有一个 Page_Error 处理程序,它重定向到 Error.aspx 页面并向用户显示一条消息。在它进行重定向之前,它会发送详细说明错误的电子邮件。

我真的不知道我的代码在哪一点失败了,但我假设它甚至没有到达 Page_Load ,因为它没有出现在堆栈跟踪中。

我每晚至少得到 3 或 4 个这样的东西——但有时在白天也是如此,有时它会干扰客户结账和其他对我客户的业务至关重要的事情。

我该如何调试呢?我必须设置什么属性来告诉它等待更长时间才能连接到服务器?

4

1 回答 1

0

嗯,您可能想进一步调查为什么会发生超时,但为了增加超时(您可能最好将其设置为特定于页面),您可以在 web.config 中执行此操作:

<location path="somefile.aspx">
    <system.web>
            <httpRuntime executionTimeout="180"/>
    </system.web>
</location>
于 2012-05-25T21:15:05.890 回答