Exception "Collection was modified" in System.Windows.Input.StylusWisp on remote desktop
See original GitHub issueHi there, got this exception today on a remote machine directly after connecting via windows remote desktop:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute. at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.ValueCollection.Enumerator.MoveNext() at System.Windows.Input.StylusWisp.WispLogic.OnTabletAdded(UInt32 wisptisIndex) at System.Windows.Input.StylusWisp.WispLogic.HandleMessage(WindowMessage msg, IntPtr wParam, IntPtr lParam) at System.Windows.SystemResources.InvalidateTabletDevices(WindowMessage msg, IntPtr wParam, IntPtr lParam) at System.Windows.SystemResources.SystemThemeFilterMessage(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)
We have a .NET Framework 4.8 WPF Program running in the background, the window was not visible at that moment. Running on Windows 11 Pro.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:10 (4 by maintainers)
Top GitHub Comments
I do have a minidump of the crash if it would be helpful.
@singhashish-wpf I never saw this bug again. What I noticed meanwhile: On Windows 11, when you run a .NET Framework 4.8 targeted program, it actually runs Framework 4.8.1 code while on windows 10 it runs 4.8 code.
Actually I’m confused about where to look for 4.8 and 4.8.1 code?
(I had this problem here with a 4.8 framework application: https://github.com/dotnet/wpf/issues/6319)