Exception:“System.Windows.Automation.Peers.AutomationPeer”的类型初始值设定项引发异常。“System.Windows.Automation.InvokePatternIdentifiers”的类型初始值设定项引发异常。引发类型为“System.OutOfMemoryException”的异常。

报错信息 1
TypeInitializationException
   在 System.Windows.Automation.Peers.AutomationPeer.RaiseFocusChangedEventHelper(IInputElement newFocus)
   在 System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)
   在 System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
   在 System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
   在 System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
   在 System.Windows.Interop.HwndKeyboardInputProvider.OnSetFocus(IntPtr hwnd)
   在 System.Windows.Interop.HwndKeyboardInputProvider.FilterMessage(IntPtr hwnd, WindowMessage message, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

TypeInitializationException
“System.Windows.Automation.InvokePatternIdentifiers”的类型初始值设定项引发异常。
   在 System.Windows.Automation.Peers.AutomationPeer.Initialize()
   在 System.Windows.Automation.Peers.AutomationPeer..cctor()

OutOfMemoryException
引发类型为“System.OutOfMemoryException”的异常。
   在 System.Windows.Automation.AutomationIdentifier.Register(AutomationIdType type, Int32 id, String programmaticName)
   在 System.Windows.Automation.AutomationPattern.Register(Patterns id, String programmaticName)
   在 System.Windows.Automation.InvokePatternIdentifiers..cctor()
版本:1.37.37 2025-01-20 09:24 Microsoft Windows NT 10.0.19045.0