Hi Steven,
After implementating the error handler as your suggestion, we've get the
following logging:
14/8/2004 12:23:41 :
Source: System.Web
Message: Exception of type System.Web.HttpUnhandledException was thrown.
Stack Trace:
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain()
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication+IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously)
Method Name: HandleError
HelpLink:
Inner Exception Source: qcmebnjq
Inner Exception Message: Object reference not set to an instance of an
object.
Inner Method Name: __Render__control1
Inner Exception HelpLink:
Base Exception Source: qcmebnjq
Base Exception Message: Object reference not set to an instance of an object.
Base Exception HelpLink:
14/8/2004 12:35:52 :
Source: System.Web
Message: Exception of type System.Web.HttpUnhandledException was thrown.
Stack Trace:
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain()
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication+IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously)
Method Name: HandleError
HelpLink:
Inner Exception Source: System.Web
Inner Exception Message: Maximum request length exceeded.
Inner Method Name: GetEntireRawContent
Inner Exception HelpLink:
Base Exception Source: System.Web
Base Exception Message: Maximum request length exceeded.
Base Exception HelpLink:
For the coding of the error handler, please refer to appendix.
The "Session Timeout" problem has occured numerious time, but there is
only one exception logged above (actually we don't know if the first
exception is related to session timeout problem). The second exception is
logged when the documents to be uploaded is larger than the asp.net limit.
Another observation we've got is that the Session Timout problem occurs
more frequently when there is more people using our application. When only 1
- 2 people using our application, the problem occurs rarely. But when more
than 5 people using the system, it would take just a few minutes to have the
problem reproduced.
Regards,
Patrick
Appendix:
protected void Application_Error(Object sender, EventArgs e)
{
// Logging the session
string REGKEYPATH="Software\\Vitova\\VitalDoc\\4.0";
RegistryKey
_appRegHandle=Registry.LocalMachine.OpenSubKey(REG KEYPATH,false);
object obj=null;
string AppErrLog ="0";
System.IO.StreamWriter sessionLog=null;
string ErrMsg="";
if (_appRegHandle != null)
{
obj=_appRegHandle.GetValue("AppErrLog");
if (obj != null)
{
AppErrLog = obj.ToString();
if (AppErrLog == "1")
{
sessionLog=new System.IO.StreamWriter("C:\\AppErrLog.log",true);
ErrMsg = System.DateTime.Now.ToString() + " : " +
GetErrLogStr(Server.GetLastError());
//ErrMsg += "Message: " + Server.GetLastError().Message;
//ErrMsg += Server.GetLastError().HelpLink;
sessionLog.WriteLine(ErrMsg);
sessionLog.Close();
sessionLog=null;
}
}
}
}
public static string GetErrLogStr(System.Exception e)
{
string ret = "";
ret += System.Environment.NewLine;
ret += "\tSource: " + e.Source;
ret += System.Environment.NewLine;
ret += "\tMessage: " + e.Message;
ret += System.Environment.NewLine;
ret += "\tStack Trace: \n" + e.StackTrace;
ret += System.Environment.NewLine;
if (e.TargetSite != null)
{
ret += "\tMethod Name: " + e.TargetSite.Name;
ret += System.Environment.NewLine;
}
ret += "\tHelpLink: " + e.HelpLink;
ret += System.Environment.NewLine;
if (e.InnerException != null)
{
ret += "\tInner Exception Source: " + e.InnerException.Source;
ret += System.Environment.NewLine;
ret += "\tInner Exception Message: " + e.InnerException.Message;
ret += System.Environment.NewLine;
if (e.InnerException.TargetSite != null)
{
ret += "\tInner Method Name: " + e.InnerException.TargetSite.Name;
ret += System.Environment.NewLine;
}
ret += "\tInner Exception HelpLink: " + e.InnerException.HelpLink;
ret += System.Environment.NewLine;
}
ret += "\tBase Exception Source: " + e.GetBaseException().Source;
ret += System.Environment.NewLine;
ret += "\tBase Exception Message: " + e.GetBaseException().Message;
ret += System.Environment.NewLine;
ret += "\tBase Exception HelpLink: " + e.GetBaseException().HelpLink;
ret += System.Environment.NewLine;
return ret;
}
"Steven Cheng[MSFT]" wrote:
Hi Patrick,
Thanks for your followup. Well, I'll hold on this issue and wait for your
good news:). Also, if you have any other findings, please feel free to
post here.
Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx