Noa*_*oah 1 silverlight unhandled-exception silverlight-4.0
在我的App()初始化代码中,我包含了一个通用的处理程序
UnhandledException += Application_UnhandledException;
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
Debugger.Break();
}
Run Code Online (Sandbox Code Playgroud)
我有2个屏幕可以正常工作,但是当在两个屏幕之间来回快速导航多次(在7到12之间变化)时,我遇到了这个断点.
{System.Windows.ApplicationUnhandledExceptionEventArgs} base {System.EventArgs}: {System.Windows.ApplicationUnhandledExceptionEventArgs}
ExceptionObject: {System.ArgumentException: Value does not fall within the expected range.}
Handled: false
Run Code Online (Sandbox Code Playgroud)
如果我删除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
Run Code Online (Sandbox Code Playgroud)
即使我设置e.handled = true,我的应用程序崩溃.
重要说明:
MVVM框架下的应用程序在99.9%的时间内工作,在几十个屏幕之间导航.只有一个用户报告能够通过在两个屏幕之间快速导航来崩溃应用程序,然后只有大约10次来回尝试
我的问题是:
有什么方法可以确定导致它的原因吗?
有什么方法可以预防吗?
从这个错误中恢复的最佳方法是什么?
跟进:
通过命名视图控件解决了这个问题,即使不需要它也是如此
从
<telnav:RadTabItem.Content>
<views:Detail_InfoView />
</telnav:RadTabItem.Content>
Run Code Online (Sandbox Code Playgroud)
至
<telnav:RadTabItem.Content>
<views:Detail_InfoView x:Name="DetailsInnerView"/>
</telnav:RadTabItem.Content>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5386 次 |
| 最近记录: |