The following exception was recorded in the log on a client system.
System.ArgumentOutOfRangeException: Value to add was out of range.
Parameter name: value
at System.DateTime.Add(Double value, Int32 scale)
at ButtonPressed()
at MessageEvent(MessageEventArgs e)
The custom method is fairly simple
Public Sub ButtonPressed
If mWindows.Count > 0 AndAlso mLastEvent.AddSeconds(1) > Now
PostMessage(New IntPtr(mHwnd), 1125, UIntPtr.Zero, IntPtr.Zero)
End If
End Sub
I am having troubles to explain how such a call stack is at all possible since DateTime.Add(Double value, Int32 scale)
is a private method and not called by my code.
DateTime.Now is throwing an exception seems to give an explanation for this in multi-threaded environments. But there is no call to DateTime.get_Now
on my call stack so is it really the same root cause?