Problem: System.ArgumentOutOfRangeException: Der TimeSpan-Zeitraum muss kleiner oder gleich "Int32.MaxValue" sein. (value must be smaller or equal "Int32.MaxValue")
Stacktrace:
bei System.Windows.Threading.DispatcherTimer.set_Interval(TimeSpan value) bei System.Windows.Controls.PopupControlService.ShowToolTip(DependencyObject o, Boolean fromKeyboard) bei System.Windows.Controls.PopupControlService.PromotePendingToolTipToCurrent(TriggerAction triggerAction) bei System.Windows.Controls.PopupControlService.<>c__DisplayClass15_0.b__0(Object s, EventArgs e) bei System.Windows.Threading.DispatcherTimer.FireTick(Object unused) bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Analysis:
Exception is thrown here: if (value.TotalMilliseconds > Int32.MaxValue) throw new ArgumentOutOfRangeException("value", SR.TimeSpanPeriodOutOfRange_TooLarge);
where value is a TimeSpan
https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/DispatcherTimer.cs#L154
The value [TimeSpan] is created here:
CurrentToolTipTimer.Interval = TimeSpan.FromMilliseconds(ToolTipService.GetShowDuration(o));
https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/PopupControlService.cs#L477
ToolTipService.GetShowDuration(o)
returns an int
This leads to the following: 'TimeSpan.FromMilliseconds(x).TotalMilliseconds > int.MaxValue' must be true
What value can x have that the exception is thrown?
** Reformulated the question because it lead to some misunderstanding. ** I don't know which of my code or third party code is relevant, that the exception is thrown. The error is not reproducable and happend 3-4 times on a program that is used on several thousand clients for several hours per day.