WPF启动失败报System.Windows.Automation.Peers.AutomationPeer.Initialize ...

打印 上一主题 下一主题

主题 955|帖子 955|积分 2865

题目描述

win10系统上WPF程序启动后就崩溃,通过查看崩溃日志如下:
   应用程序: xxx.exe
Framework 版本: v4.0.30319
说明: 由于未经处置惩罚的非常,进程停止。
非常信息: System.TypeLoadException
在 System.Windows.Automation.Peers.AutomationPeer.Initialize()
在 System.Windows.Automation.Peers.AutomationPeer…cctor()
  这里是引用
  非常信息: System.TypeInitializationException 在
System.Windows.Automation.Peers.AutomationPeer.RaiseFocusChangedEventHelper(System.Windows.IInputElement)

System.Windows.Input.KeyboardDevice.ChangeFocus(System.Windows.DependencyObject,
Int32) 在
System.Windows.Input.KeyboardDevice.TryChangeFocus(System.Windows.DependencyObject,
System.Windows.Input.IKeyboardInputProvider, Boolean, Boolean,
Boolean) 在
System.Windows.Input.KeyboardDevice.Focus(System.Windows.DependencyObject,
Boolean, Boolean, Boolean) 在
System.Windows.Input.KeyboardDevice.Focus(System.Windows.IInputElement)
在 System.Windows.Interop.HwndKeyboardInputProvider.OnSetFocus(IntPtr)

System.Windows.Interop.HwndKeyboardInputProvider.FilterMessage(IntPtr,
MS.Internal.Interop.WindowMessage, IntPtr, IntPtr, Boolean ByRef) 在
System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr, Int32,
IntPtr, IntPtr, Boolean ByRef) 在
MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean
ByRef) 在
MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object) 在
System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate,
System.Object, Int32) 在
System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object,
System.Delegate, System.Object, Int32, System.Delegate) 在
System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority,
System.TimeSpan, System.Delegate, System.Object, Int32) 在
MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
  解决方案:

方案一:升级windows系统

如果当前系统有升级,手动升级系统,一般系统题目都可以通过升级来解决
方案二:卸载windows更新

通过查找资料和推测,可能是windows更新导致了这个题目,此中github中也有这个题目:
https://github.com/dotnet/wpf/issues/8056
再和我当前有题目标这台电脑比较,发现了这个更新可能有题目:KB5011048

卸载后重启,软件正常。
备注:

  • 如果发现软件本日运行正常,第二天再运行时出现如上错误,大概率就是更新出现了题目,可以通过这个方法去扫除。
  • KB5011048不一定是唯一,有时可能需要具体题目具体分析,但都可以从这个更新包入手

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

九天猎人

金牌会员
这个人很懒什么都没写!
快速回复 返回顶部 返回列表