wp7 and throw new exception for quiting app

.NET obfuscator and automated error reporting

wp7 and throw new exception for quiting app

Postby iosub » Tue Mar 08, 2011 10:00 pm


I'm using a hack to quit the wp7 SL app if the user cancel the login..

this is the code
namespace MSP.Phone.Exceptions
public class Custom
public class QuitException : Exception { }

public static void Quit()
throw new QuitException();

and on the app.xaml.cs

private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
if (e.ExceptionObject is MSP.Phone.Exceptions.Custom.QuitException)

if (System.Diagnostics.Debugger.IsAttached)
// An unhandled exception has occurred; break into the debugger

my problem is that I have enable SA reporting, so every time the user cancel the login screen, the SA Reporting catch the execption.

Is there a way to cancel the SA reporting in this situation.. Maybe with a attribute??

Unfortunately WP7 does not have a app.quit option so this is the only way to quit the app.

any solution?

Posts: 19
Joined: Tue Oct 19, 2010 2:40 pm

Postby Chris.Allen » Thu Mar 10, 2011 7:40 pm

The most recent version of SA catches WPF exceptions and tries whenever possible to let the app *continue* which is what 99% of developers would generally wish to happen.
Posts: 579
Joined: Thu Mar 12, 2009 3:17 pm

Return to SmartAssembly 6

Who is online

Users browsing this forum: No registered users and 0 guests