R
Ram P. Dash
Hi,
I've a c# windows service constantly communicating with an ASP.NET web
service. After running for sometime, I am getting the following exception at
the windows service (client):
Object reference not set to an instance of an object.
[Stack Trace: at System.Net.HttpWebRequest.ClearRequestForResubmit()
at System.Net.HttpWebRequest.DoSubmitRequestProcessing()
at System.Net.HttpWebRequest.SetResponse(CoreResponseData
coreResponseData)
at System.Net.ConnectionReturnResult.SetResponses(ConnectionReturnResult
returnResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
at System.Net.Sockets.OverlappedAsyncResult.CompletionPortCallback(UInt32
errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)]
Since this exception doesn't occure in any code block, I can only catch it
by doing the following:
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.UnhandledException += new
UnhandledExceptionEventHandler(DefaultHandler);
In my DefaultHandler, I've the failover code. Even then, the windows service
doesn't fully recover. All the static variables (reference types) in the
class just loose their referrence.
What's going on?
Thanks,
Ram
I've a c# windows service constantly communicating with an ASP.NET web
service. After running for sometime, I am getting the following exception at
the windows service (client):
Object reference not set to an instance of an object.
[Stack Trace: at System.Net.HttpWebRequest.ClearRequestForResubmit()
at System.Net.HttpWebRequest.DoSubmitRequestProcessing()
at System.Net.HttpWebRequest.SetResponse(CoreResponseData
coreResponseData)
at System.Net.ConnectionReturnResult.SetResponses(ConnectionReturnResult
returnResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
at System.Net.Sockets.OverlappedAsyncResult.CompletionPortCallback(UInt32
errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)]
Since this exception doesn't occure in any code block, I can only catch it
by doing the following:
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.UnhandledException += new
UnhandledExceptionEventHandler(DefaultHandler);
In my DefaultHandler, I've the failover code. Even then, the windows service
doesn't fully recover. All the static variables (reference types) in the
class just loose their referrence.
What's going on?
Thanks,
Ram