ArgumentOutOfRangeException from HttpWebRequest.GetResponse

  • Thread starter Thread starter kevin cline
  • Start date Start date
K

kevin cline

Sporadically I am getting an ArgumentOutOfRangeException thrown from a
call
to HttpWebRequest.GetResponse(). The stack trace is:

at System.DateTime.DateToTicks()
at System.DateTime..ctor()
at System.CurrentSystemTimeZone.GetDayOfWeek()
at System.CurrentSystemTimeZone.GetDaylightChanges()
at System.CurrentSystemTimeZone.GetUtcOffsetFromUniversalTime()
at System.CurrentSystemTimeZone.ToLocalTime()
at System.DateTime.ToLocalTime()
at System.DateTime.get_Now()
at System.Net.ServicePointManager.ScavengeOnMainThread()
at System.Net.ServicePointManager.FindServicePoint()
at System.Net.HttpWebRequest.SubmitRequest()
at System.Net.HttpWebRequest.finishGetResponse()
at System.Net.HttpWebRequest.GetResponse()
...

It seems the exception is coming from an internal call to DateTime.Now.

Has anyone else seen this?
 
This is actually exciting. Can you catch this exception in debugger and
write down the exact time on the device complete with the date and the
timezone?
Also, could you confirm that when this happens, DateTime.Now throws an
exception as well?
 
I don't find it exciting as much as I find it annoying. The
ArgumentOutOfRange exception has been observed from both
GetRequestStream and GetResponse calls.

I can't catch it in the debugger because VS2005 becomes "busy" until
the device is rebooted. However, when the exception is caught,
DateTime.Now does not throw an exception, and I an able to write the
following log:

01:32:57
Specified argument was out of the range of valid values.
at System.DateTime.DateToTicks()
at System.DateTime..ctor()
at System.CurrentSystemTimeZone.GetDayOfWeek()
at System.CurrentSystemTimeZone.GetDaylightChanges()
at System.CurrentSystemTimeZone.GetUtcOffsetFromUniversalTime()
at System.CurrentSystemTimeZone.ToLocalTime()
at System.DateTime.ToLocalTime()
at System.DateTime.get_Now()
at System.Net.ServicePointManager.ScavengeOnMainThread()
at System.Net.ServicePointManager.FindServicePoint()
at System.Net.HttpWebRequest.SubmitRequest()
at System.Net.HttpWebRequest.finishGetRequestStream()
at System.Net.HttpWebRequest.GetRequestStream()
 
Kevin, can you tell me what locale are you currently in? Also, can you
tell me which version of CF2.0 you are using? (run
\windows\cgacutil.exe and it'll pop up the version number) I'd like to
see if I can get this to repro. Thank you.
 
What's the timezone on the device and what kind of device are you
using? Is it is some non-default calendar setting? Can you send the
regional settings that you have specified? Are you using a custom CE
image or are you using a Pocket PC or smartphone.
 
Back
Top