[英]NullReferenceException in System.Runtime.CompilerServices.AsyncServices.<ThrowAsync>b__1()
[英]Exceptions in System.Runtime.CompilerServices.AsyncServices without my code in stack trace
我的应用程序的某些用户由于System.Runtime.CompilerServices.AsyncServices中的不同异常而遇到了奇怪的崩溃
堆栈跟踪中没有我的代码,而且我不知道在哪里查找原因或如何添加其他日志记录以查找崩溃原因。 谷歌搜索没有帮助。
例外的例子有:
String reference not set to an instance of a String. Parameter name: s Void System.Runtime.CompilerServices.AsyncServices.b__0(System.Object) System.Object System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) System.Object MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) Void System.Windows.Threading.DispatcherOperation.InvokeImpl() Void System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object) Void System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) Void System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) Void System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) Void System.Windows.Threading.DispatcherOperation.Invoke() Void System.Windows.Threading.Dispatcher.ProcessQueue() IntPtr System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) IntPtr MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) System.Object MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object) System.Object System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) System.Object MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) System.Object System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32) IntPtr MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr) IntPtr MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef) Void System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame) Void System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame) Void System.Windows.Threading.Dispatcher.Run() System.Object System.Windows.Application.RunDispatcher(System.Object) Int32 System.Windows.Application.RunInternal(System.Windows.Window) Int32 System.Windows.Application.Run(System.Windows.Window) Int32 System.Windows.Application.Run() App.g.cs - Void MyProject.App.Main()
Object reference not set to an instance of an object. Void System.Runtime.CompilerServices.AsyncServices.b__0(System.Object) System.Object System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) System.Object MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) Void System.Windows.Threading.DispatcherOperation.InvokeImpl() Void System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object) Void System.Threading.ExecutionContext.runTryCode(System.Object) Void System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object) Void System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) Void System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) Void System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) System.Object System.Windows.Threading.DispatcherOperation.Invoke() Void System.Windows.Threading.Dispatcher.ProcessQueue() IntPtr System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) IntPtr MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) System.Object MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object) System.Object System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) System.Object MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) System.Object System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32) IntPtr MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr) IntPtr MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef) Void System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame) Void System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame) System.Object System.Windows.Application.RunDispatcher(System.Object) Int32 System.Windows.Application.RunInternal(System.Windows.Window) Int32 System.Windows.Application.Run(System.Windows.Window) Int32 System.Windows.Application.Run() App.g.cs - Void MyProject.App.Main()
附加信息:我的目标是NET 4.0,并使用Microsoft.Bcl.Async。 上面描述的第一个例外发生在装有Win 7 / NET 4.0的计算机上
更新:我将尝试澄清这个问题。
如果异步方法中发生某些异常,似乎可以显示这些堆栈跟踪。 有没有办法找到发生原始异常的地方? 因为调试此类问题非常困难,只知道异常消息,否则一无所知。
由于似乎没人知道更好的解决方案,因此我将发布我使用过的解决方案。
我发现导致这些崩溃之一的原始异常总是总是首先触发FirstChanceException事件。
为了知道导致异常的原因,我做了以下工作:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.