没有客户端代码牵连时如何调试异常? [英] How to debug exception when no client code is implicated?

查看:47
本文介绍了没有客户端代码牵连时如何调试异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi,

有时,我的客户端计算机会抛出异常,并通过电子邮件向我发送异常详细信息,如下所示

Occasionally my client machines throw exceptions and email me the exception details as shown here

****** LastChanceHandler ****** v1.1.0.1040 ExceptionType:TargetInvocationException帮助热线:消息:调用的目标已引发异常.来源:mscorlib StackTrace:位于 System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo方法,对象目标,Object []参数,SignatureStruct&sig,MethodAttributes methodAttributes,RuntimeType typeOwner)位于 System.Reflection.RuntimeMethodInfo.Invoke(Object obj,BindingFlags invokeAttr,活页夹装订器,Object []参数,CultureInfo文化,布尔skipVisibilityChecks)在 System.Delegate.DynamicInvokeImpl(Object [] args)在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(委托回调,对象args,Int32 numArgs)位于 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(对象源,委托方法,对象args,Int32 numArgs,委托catchHandler)在 System.Windows.Threading.Dispatcher.WrappedInvoke(委托回调,对象args,Int32 numArgs,委托catchHandler) System.Windows.Threading.DispatcherOperation.InvokeImpl()在 System.Threading.ExecutionContext.runTryCode(Object userData)在 System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode代码,CleanupCode backoutCode,对象userData)位于 System.Threading.ExecutionContext.Run(ExecutionContext executeContext,ContextCallback回调,对象状态,布尔ignoreSyncCtx)位于 System.Threading.ExecutionContext.Run(ExecutionContext executeContext,ContextCallback回调,对象状态)位于 System.Windows.Threading.DispatcherOperation.Invoke()在 System.Windows.Threading.Dispatcher.ProcessQueue()在 System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd,Int32 msg,IntPtr wParam,IntPtr lParam,布尔值和已处理) MS.Win32.HwndWrapper.WndProc(IntPtr hwnd,Int32 msg,IntPtr wParam,IntPtr lParam,布尔值和已处理) MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(委托回调,对象args,Int32 numArgs)位于 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(对象源,委托方法,对象args,Int32 numArgs,委托catchHandler)在 System.Windows.Threading.Dispatcher.WrappedInvoke(委托回调,对象args,Int32 numArgs,委托catchHandler) System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority优先级,TimeSpan超时,委托方法,对象args,Int32 numArgs)位于 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd,Int32 msg,IntPtr wParam,IntPtr lParam) MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)位于 System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)位于 System.Windows.Application.RunInternal(窗口窗口)位于 System.Windows.Application.Run()位于 C:\ Visual Studio 2010 Projects \ HAL \ v1.1 \ Lovatts.HAL \ obj \ x64 \ Debug \ App.g.cs:line 0 TargetSite:System.Object _InvokeMethodFast(System .IRuntimeMethodInfo,System.Object,System.Object [],System.SignatureStruct ByRef,System.Reflection.MethodAttributes,System.RuntimeType)

****** LastChanceHandler ****** v1.1.0.1040 ExceptionType: TargetInvocationException HelpLine: Message: Exception has been thrown by the target of an invocation. Source: mscorlib StackTrace: at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Delegate.DynamicInvokeImpl(Object[] args) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run() at Lovatts.Scheduling.App.Main() in C:\Visual Studio 2010 Projects\HAL\v1.1\Lovatts.HAL\obj\x64\Debug\App.g.cs:line 0 TargetSite: System.Object _InvokeMethodFast(System.IRuntimeMethodInfo, System.Object, System.Object[], System.SignatureStruct ByRef, System.Reflection.MethodAttributes, System.RuntimeType)

******内部异常****** ExceptionType :ArgumentOutOfRangeException帮助热线:消息:索引超出范围.必须为非负数并且小于集合的大小.参数名称:index来源:mscorlib StackTrace:在 System.Collections.Generic.List`1.get_Item(Int32索引)位于 System.Collections.ObjectModel.Collection`1.System.Collections.IList.get_Item(Int32索引)位于 System.Windows.Controls.Primitives.Selector.CoerceSelectedItem(DependencyObject d,Object value)在 System.Windows.DependencyObject.ProcessCoerceValue(DependencyProperty dp,PropertyMetadata元数据,EntryIndex& entryIndex,Int32& targetIndex,EffectiveValueEntry& newEntry,EffectiveValueEntry& oldEntry,Object& oldValue,Object baseValue,Object controlValue,CoerceValueCallbackCoerceValueWithback, skipBaseValueChecks)在 System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex,DependencyProperty dp,PropertyMetadata元数据,EffectiveValueEntry oldEntry,EffectiveValueEntry& newEntry,布尔值coerceWithDeferredReference,布尔值coerceWithCurrentValue,OperationType操作类型) System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp,对象值,PropertyMetadata元数据,布尔值coerceWithDeferredReference,布尔值coerceWithCurrentValue,OperationType operationType,布尔值isInternal)位于 System.Windows.DependencyObject.SetCurrentValue(DependencyProperty dp,对象值)在 System.Windows.DependencyObject.CoerceValue(DependencyProperty dp)位于 System.Windows.Controls.Primitives.Selector.OnItemsChanged(NotifyCollectionChangedEventArgs e)在 System.Windows.Controls.ListView.OnItemsChanged(NotifyCollectionChangedEventArgs e)在 System.Windows.Controls.ItemsControl.OnItemCollectionChanged(Object sender,NotifyCollectionChangedEventArgs e)在 System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender,NotifyCollectionChangedEventArgs e)在 System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)在 System.Windows.Controls.ItemCollection.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType,Object sender,EventArgs e)在 System.Windows.WeakEventManager.DeliverEventToList(对象发送者,EventArgs参数,ListenerList列表)位于 System.Windows.WeakEventManager.DeliverEvent(Object sender,EventArgs args)在 System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)在 System.Windows.Data.ListCollectionView.ProcessCollectionChangedWithAdjustedIndex(NotifyCollectionChangedEventArgs args,Int32调整后的OldIndex,Int32调整后的NewIndex)TargetSite:T get_Item(Int32)

****** Inner Exception ****** ExceptionType: ArgumentOutOfRangeException HelpLine: Message: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Source: mscorlib StackTrace: at System.Collections.Generic.List`1.get_Item(Int32 index) at System.Collections.ObjectModel.Collection`1.System.Collections.IList.get_Item(Int32 index) at System.Windows.Controls.Primitives.Selector.CoerceSelectedItem(DependencyObject d, Object value) at System.Windows.DependencyObject.ProcessCoerceValue(DependencyProperty dp, PropertyMetadata metadata, EntryIndex& entryIndex, Int32& targetIndex, EffectiveValueEntry& newEntry, EffectiveValueEntry& oldEntry, Object& oldValue, Object baseValue, Object controlValue, CoerceValueCallback coerceValueCallback, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, Boolean skipBaseValueChecks) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal) at System.Windows.DependencyObject.SetCurrentValue(DependencyProperty dp, Object value) at System.Windows.DependencyObject.CoerceValue(DependencyProperty dp) at System.Windows.Controls.Primitives.Selector.OnItemsChanged(NotifyCollectionChangedEventArgs e) at System.Windows.Controls.ListView.OnItemsChanged(NotifyCollectionChangedEventArgs e) at System.Windows.Controls.ItemsControl.OnItemCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e) at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args) at System.Windows.Controls.ItemCollection.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e) at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list) at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args) at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args) at System.Windows.Data.ListCollectionView.ProcessCollectionChangedWithAdjustedIndex(NotifyCollectionChangedEventArgs args, Int32 adjustedOldIndex, Int32 adjustedNewIndex) TargetSite: T get_Item(Int32)

我是否有办法康复,从StackTrace找出我做错了什么,或者指出正确的方向?我编写的代码似乎都没有牵连.我至少可以通过某种方法找出与View或ViewModel有关吗? 我目前收到的唯一信息是来自人类的反馈和上述异常日志.有更好的方法吗?

Is there any way for me to well, find out what I've done wrong from the StackTrace, or point me in the right direction? None of the code I've written seems to be implicated. Is there some way I can at least find out with View or ViewModel is implicated? The only information I currently receive is from human feedback and exception logs like the above. Is there a better way to do this?

亲切的问候,

马特

推荐答案

马特,

我能看到的所有信息都是"ArgumentOutOfRangeException"例外,由于"System.Collections.Generic.List`1.get_Item(Int32 index)"位于这个,所以某个对象试图访问一个不存在的值,我看不到 您的代码,所以我对此不建议,相反,您可以检查代码,以免发生IndexOutOfRange异常,为此,尝试编写安全代码,然后再获取带有索引的任何内容,首先检查您是否在收集长度以下,好像 成为一个非常聪明的人,我认为这个故事很深,没有太多表面问题.可以.

All i can see that you are getting "ArgumentOutOfRangeException" Exception, and this is happening because of "System.Collections.Generic.List`1.get_Item(Int32 index) at " this, so some object is trying to access a value which is not there, I can not see your code so I can not advice on that, rather, you can check the code so that there is no IndexOutOfRange Exception occurs, for this try to write safe code, before getting anything with index first check if you are bellow the collection length, you seems to be a very smart guy and I am assuming that the story is very deep and not that much surface problem. Any way.

关于是否涉及View或ViewModel?",这是我们为thomson开发的非常成功的产品之一,采用了以下波纹管方法.

About "View or ViewModel is implicated?", one of our very successful product that we build for thomson used kind of bellow approach.

每次用户导航到模块时,我们都会跟踪堆栈中的模块更改,我们会有一个工具管理器负责照顾棱镜模块并按需加载用户导航的对象,然后如果用户开始使用在中导航或使用工具 一个模块,我们将委托命令的历史记录保存在一个堆栈中,这两个堆栈都连同堆栈跟踪一起发送给我们,以便我们知道应用程序遇到异常时用户所在的位置,更进一步,我们要求用户允许发送屏幕截图 当应用程序崩溃时,屏幕捕获机制是自动的.在90%的情况下,收到这些数据后,我们即刻解决了问题.但是,我们仍然会发现一些幽灵异常,最终无法解决问题.

Each time a user navigate to a module we track the module changes in a stack, we had a tool manager kind of thing who take care of the prism modules and load on demand which ever user navigates, after that if user start using navigating or using tool in a module we keep the delegate command's history in a stack, both the stack is sent to us along with the stack trace, so that we know where the user was when the application suffered from an exception, farther more we asked the user to allow send a screen shot of the application when it crashed, the screen capture mechanism is automated. Upon receiving those data in 90% of the case we resolved the problems in a flash. However, we still find some ghost exception and end up going nowhere close to solution.

我不确定这对您有什么帮助,但认为值得分享经验,因为您可能会从中找到一些有趣的东西.

I am not sure how this will help you but thought its worth sharing the experience as you might find something interesting out of it.


这篇关于没有客户端代码牵连时如何调试异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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