(ToolTip ) System.ArgumentNullException: Value cannot be null. (Parameter 'element')
See original GitHub issue- .NET Core Version: 6.0.3
- Windows version: Win10
- Does the bug reproduce also in WPF for .NET Framework 4.8?: Repros on .NET 4.8.1 only.
- Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc…)?: No
Problem description: App Crash … the Problem should be resolved but it comes again and again.
BTW: I don’t use any Tooltip in my App, regardless the problem come again and again during the working!
Actual behavior:
Application: Project.exe CoreCLR Version: 6.0.322.12309 .NET Version: 6.0.3 Description: The process was terminated due to an unhandled exception. Exception Info: System.ArgumentNullException: Value cannot be null. (Parameter ‘element’) at System.Windows.Controls.ToolTipService.GetBetweenShowDelay(DependencyObject element) at System.Windows.Controls.PopupControlService.CloseToolTip(ToolTip tooltip) at System.Windows.Controls.PopupControlService.OnPostProcessInput(Object sender, ProcessInputEventArgs e) at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(Tuple`2 postProcessInput, ProcessInputEventArgs processInputEventArgs) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.MouseDevice.Synchronize() at System.Windows.Input.MouseDevice.ChangeMouseCapture(IInputElement mouseCapture, IMouseInputProvider providerCapture, CaptureMode captureMode, Int32 timestamp) at System.Windows.Input.MouseDevice.Capture(IInputElement element, CaptureMode captureMode) at CefSharp.Wpf.ChromiumWebBrowser.OnMouseDown(MouseButtonEventArgs e) in C:\projects\cefsharp\CefSharp.Wpf\ChromiumWebBrowser.cs:line 2239 at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.Run() at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run() at Application.Desktop.App.Main()
Expected behavior: App should not be crashed
How could i solve the Problem fastly ?
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:56 (15 by maintainers)
Top GitHub Comments
Many of our customers are experiencing this exception (and exact same call stack) as well. Not sure if this helps, but just thought I’d add what we have found:
Steps to replicate:
Our devs were unable to replicate this on a Windows 10 development machine (with just the .Net 4.8 framework installed), But if they downloaded and installed .Net 4.8.1, they CAN reproduce it with the same application (not rebuilt) fairly easily.
In Windows 10 (with .Net 4.8), after waiting sufficiently long enough, the tooltip auto-disappears. After installing .Net Framework 4.8.1, we noticed the tooltip does not auto-disappear.
We have tried various combinations of the Switch.UseLegacyToolTipDisplay and related settings mentioned in the article in the previous post, but with no success.
It’s a little embarrassing as we have no way to trap the exception, and some users are getting this exception many times a day.
If I understood correctly, they can already reproduce the issue and have a fix for it. But unfortunately, there is no new information since.