Multithreading WP8应用程序如何处理在另一个线程上从Webbrowser.InvokeScript引发的异常?

Multithreading WP8应用程序如何处理在另一个线程上从Webbrowser.InvokeScript引发的异常?,multithreading,exception,windows-phone-8,try-catch,Multithreading,Exception,Windows Phone 8,Try Catch,我试图在我的WP8应用程序中加入AdMob广告,并注意到一定比例的广告通常是基于文本的广告,但并不总是抛出以下异常: A first chance exception of type 'System.SystemException' occurred in Microsoft.Phone.Interop.ni.dll 我做了大量的挖掘工作,发现在尝试使用下面的InvokeScript stacktrace时,一些admob填隙文件出现了问题 Microsoft.Phone.Interop.ni

我试图在我的WP8应用程序中加入AdMob广告,并注意到一定比例的广告通常是基于文本的广告,但并不总是抛出以下异常:

A first chance exception of type 'System.SystemException' occurred in Microsoft.Phone.Interop.ni.dll
我做了大量的挖掘工作,发现在尝试使用下面的InvokeScript stacktrace时,一些admob填隙文件出现了问题

Microsoft.Phone.Interop.ni.dll!Microsoft.Phone.Controls.NativeMethods.ValidateHResult(int hr)
Microsoft.Phone.Interop.ni.dll!Microsoft.Phone.Controls.WebBrowserInterop.InvokeScript(string scriptName, string[] args)
Microsoft.Phone.ni.dll!Microsoft.Phone.Controls.WebBrowser.InvokeScript(string scriptName, string[] args)
GoogleAds.DLL!A.c778af7b26605e0bb7fadf1547d7f5530.c379e3fb7ee502b62de5eee847f1352a2(string c1966769b4ad56530475a20642e40c06c)
这大概是因为一些广告形式不好,只是一个猜测,但我想知道,当抛出异常时,是否有什么方法可以让我抓住,我到目前为止还没有任何运气。Admob调用正在使用beginInvoke,因此它们不在同一线程上,因此,下面的典型模式不会导致断点被命中。我已确保选中了visual studio在异常跨越AppDomain或本机/托管边界时的中断选项

应用程序下

UnhandledException += Application_UnhandledException;
处理程序方法:

private void Application_UnhandledException(object sender,     ApplicationUnhandledExceptionEventArgs e)
{
    if (System.Diagnostics.Debugger.IsAttached)
    {
        // An unhandled exception has occurred; break into the debugger
        System.Diagnostics.Debugger.Break();
    }
}

有什么方法可以捕获这些异常吗?

我找到了这个问题的解决方案,它让我有了一个异常处理程序,即使在不同的线程上也会被调用