1
恢復我的應用程序()初始化代碼,我有一個通用處理器如何從一個Silverlight UnhandledException
UnhandledException += Application_UnhandledException;
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
Debugger.Break();
}
我有兩個屏幕,做工精細,但很快導航來回兩個屏幕之間時次數(不同7和12之間),我打這個斷點與異常
{System.Windows.ApplicationUnhandledExceptionEventArgs} base {System.EventArgs}: {System.Windows.ApplicationUnhandledExceptionEventArgs}
ExceptionObject: {System.ArgumentException: Value does not fall within the expected range.}
Handled: false
,如果我刪除UnhandledException並設置調試器與未處理的突破,我得到如下:
Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.Windows.Markup.XamlParseException: 2028 An error has occurred. [Line: 0 Position: 0] ---> System.ArgumentException: [Arg_ArgumentException]
Arguments: Debugging resource strings are unavailable.
Often the key and arguments provide sufficient information to diagnose the problem.
See http://go.microsoft.com/fwlink/?linkid=106663&Version=4.0.60531.0&File=mscorlib.dll&Key=Arg_ArgumentException
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.Collection_AddValue[T](PresentationFrameworkCollection`1 collection
即使我設置了e.handled = true
,我的應用程序崩潰了。
重要提示:
的應用,下MVVM框架工作超過99.9%的時間,幾十個屏幕之間進行導航。只有一個用戶報告能夠通過兩個屏幕之間快速導航,然後只在大約10迴應用程序崩潰,來回試圖
我的問題是:
任何方法來確定是什麼原因造成的呢?
有什麼辦法來防止它?
從此錯誤中恢復的最佳方法是什麼?
這也幫助了我,非常奇怪。 – deafsheep
哇......我已經在這個問題上撞了兩天了。我確定這是一些與將某些佈局重構爲UserControl和/或將Bindings集合設置正確有關的奇怪現象。所有需要的是在父視圖上(在引用新UserControl的元素上)設置'x:Name',並且未處理的異常消失。 – JaredReisinger
奇怪......但它工作:) – Khurram