WPF应用程序因调用Environment.FailFast而崩溃 [英] WPF application crash with a call to Environment.FailFast

查看:327
本文介绍了WPF应用程序因调用Environment.FailFast而崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我的WPF应用程序崩溃了,我从事件日志中找到了以下信息。


描述:该应用程序通过System.Environment.FailFast(字符串消息)请求进程终止。 
消息:不可恢复的系统错误。
Stack:
at System.Environment.FailFast(System.String)
at MS.Internal.Invariant.FailFast(System.String,System.String)
at System.Windows .Interop.ActiveXHost.OnLostFocus(System.Object,System.Windows.Input.KeyboardFocusChangedEventArgs)
at System.Windows.Input.KeyboardFocusChangedEventArgs.InvokeEventHandler(System.Delegate,System.Object)
at System.Windows .RoutedEventArgs.InvokeHandler(System.Delegate,System.Object)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object,System.Windows.RoutedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(System .Object,System.Windows.RoutedEventArgs,Boolean)
at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject,System.Windows.RoutedEventArgs)
at System.Windows.UIElement.RaiseTrustedEvent(System .Windows.RoutedEventArgs)
在System.Windows.Input.InputManager.ProcessStagingArea()
在System.Windows.Input.InputManager.ProcessInput(System.Windows.Input。 System.Windows.Input.KeyboardDevice.TryChangeFocus(System.Windows.DependencyObject,System.Windows)中的System.Windows.Input.KeyboardDevice.ChangeFocus(System.Windows.DependencyObject,Int32)
处的
。 Input.IKeyboardInputProvider,Boolean,Boolean,Boolean)
at System.Windows.Input.KeyboardDevice.Focus(System.Windows.DependencyObject,Boolean,Boolean,Boolean)
at System.Windows.Input.KeyboardDevice。 Focus(System.Windows.IInputElement)
at System.Windows.Interop.HwndKeyboardInputProvider.OnSetFocus(IntPtr)
at System.Windows.Interop.HwndKeyboardInputProvider.FilterMessage(IntPtr,MS.Internal.Interop.WindowMessage, IntPtr,IntPtr,Boolean ByRef)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr,Int32,IntPtr,IntPtr,Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr,Int32, IntPtr,IntPtr,Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper。 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object,System.Delegate,System.Object,Int32,System.Delegate)中的InternalRealCall(System.Delegate,System.Object,Int32)

at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority,System.TimeSpan,System.Delegate,System.Object,Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr,Int32,IntPtr) ,IntPtr)
at MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr,IntPtr,Int32,IntPtr,IntPtr)
at MS.Win32.HwndSubclass.DefWndProcWrapper(IntPtr,Int32,IntPtr,IntPtr)
在MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr,IntPtr,Int32,IntPtr,IntPtr)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr,Int32,IntPtr,IntPtr)
at MS.Win32。 UnsafeNativeMethods.ShowWindow(System.Runtime.InteropServices.HandleRef,Int32)
在System.Windows.Window.ShowHelper(System.Object)
at System.Windows.Window.Show()
at System.Windows.Window.ShowDialog()
at MyApplication.MyWindow.ShowDialog()







出了什么问题?  任何建议都会有所帮助。



谢谢。



解决方案

您好Vishnu,


您可以查看一个线程,它建议您关闭窗口服务调用。


https://stackoverflow.com/questions/24673421/wpf-crashing-by-environment-failfast



最好的问候,


Cherry


Hi,

My WPF application crashed and I found the following information from the event log.

Description: The application requested process termination through System.Environment.FailFast(string message). 
Message: Unrecoverable system error. 
Stack:
at System.Environment.FailFast(System.String)
at MS.Internal.Invariant.FailFast(System.String, System.String)
at System.Windows.Interop.ActiveXHost.OnLostFocus(System.Object, System.Windows.Input.KeyboardFocusChangedEventArgs)
at System.Windows.Input.KeyboardFocusChangedEventArgs.InvokeEventHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
at System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
at System.Windows.Input.KeyboardDevice.ChangeFocus(System.Windows.DependencyObject, Int32)
at System.Windows.Input.KeyboardDevice.TryChangeFocus(System.Windows.DependencyObject, System.Windows.Input.IKeyboardInputProvider, Boolean, Boolean, Boolean)
at System.Windows.Input.KeyboardDevice.Focus(System.Windows.DependencyObject, Boolean, Boolean, Boolean)
at System.Windows.Input.KeyboardDevice.Focus(System.Windows.IInputElement)
at System.Windows.Interop.HwndKeyboardInputProvider.OnSetFocus(IntPtr)
at System.Windows.Interop.HwndKeyboardInputProvider.FilterMessage(IntPtr, MS.Internal.Interop.WindowMessage, IntPtr, IntPtr, Boolean ByRef)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr, IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.HwndSubclass.DefWndProcWrapper(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr, IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.ShowWindow(System.Runtime.InteropServices.HandleRef, Int32)
at System.Windows.Window.ShowHelper(System.Object)
at System.Windows.Window.Show()
at System.Windows.Window.ShowDialog()
at MyApplication.MyWindow.ShowDialog()


What went wrong? Any suggestion would be helpful.

Thanks.

解决方案

Hi Vishnu,

One thread that you can take a look, it suggests you to turn off a window service call.

https://stackoverflow.com/questions/24673421/wpf-crashing-by-environment-failfast

Best Regards,

Cherry


这篇关于WPF应用程序因调用Environment.FailFast而崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆