Search:
Namespaces
Discussions
.NET v1.1
Feedback
How do you catch *this* exception?
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspngdebug' list
.
Chris Rickard
-- Moved from [aspngfreeforall] to [aspngdebug] by Clint Barton <
Click here to reveal e-mail address
> --
Does anyone know how to trap/catch this event? I have an intermittent
problem that occurs when a page does not come back in a reasonable time (180
secs). Here is the error:
Server Application Unavailable
The web application you are attempting to access on this web server is
currently unavailable. Please hit the "Refresh" button in your web browser
to retry your request.
Administrator Note: An error message detailing the cause of this specific
request failure can be found in the system event log of the web server.
Please review this log entry to discover what caused this error to occur.
The event log shows the following:
aspnet_wp.exe (PID: 1856) was recycled because it was suspected to be in a
deadlocked state. It did not send any responses for pending requests in the
last 180 seconds.
Clearly, the system treats this as a page request that is never coming back
so it kills the asp.net worker thread. How do you catch this? You can
simulate this problem with the following code from a webform with a single
command button (Button1). It will never hit the catch part of the exception
handler.
public class WebForm1 : System.Web.UI.
Page
{
protected System.Web.UI.WebControls.
Button
Button1;
private void Page_Load(object sender, System.
EventArgs
e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(
EventArgs
e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Button1.Click += new System.
EventHandler
(this.Button1_OnClick);
this.Load += new System.
EventHandler
(this.Page_Load);
}
#endregion
private void Button1_OnClick(object sender, System.
EventArgs
e)
{
ulong i = 0;
try
{
for (;;)
{
//count until it times out
i++;
}
}
catch(Exception ex)
{
System.Diagnostics.
Debug
.WriteLine("Error: {0}",ex.ToString());
}
}
}
}
I also placed a debug statement in the GLOBAL.ASAX file. It's never hit
either:
protected void Application_Error(Object sender,
EventArgs
e)
{
System.Diagnostics.
Debug
.WriteLine("Error: {0}",e.ToString());
}
That's all I know -- any ideas? TIA!
Reply to this message...
Brad Kingsley
Have you seen this KB article?
http://support.microsoft.com/default.aspx?scid=kb
;ZH-CN;q321792
~Brad Kingsley
Microsoft MVP - ASP
Windows 2000 MCSE
http://www.orcsweb.com/
Powerful Web Hosting Solutions
#1 in Service and Support
----- Original Message -----
From: "Chris Rickard" <
Click here to reveal e-mail address
>
To: "aspngdebug" <
Click here to reveal e-mail address
>
Sent: Wednesday, June 12, 2002 12:30 AM
Subject: [aspngdebug] How do you catch *this* exception?
> -- Moved from [aspngfreeforall] to [aspngdebug] by Clint Barton
<
Click here to reveal e-mail address
> --
[Original message clipped]
Reply to this message...
System.Diagnostics.Debug
System.EventArgs
System.EventHandler
System.Web.UI.Page
System.Web.UI.WebControls.Button
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com