Only enable messagebox exception handling in release mode

Debug builds are meant to be executed in a IDE environment, so it is better to take advantage of the IDE's features to show where the exception came from.
This commit is contained in:
Stephan Sundermann committed 2013-12-22 17:25:31 +01:00
1 parent 4c188f1cc5
commit cc1faefc38
1 file changed
+6
+6
View File
@@ -45,11 +45,14 @@ namespace Vocaluxe
private static void Main(string[] args)
// ReSharper restore InconsistentNaming
{
#if !DEBUG
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;
#endif
AppDomain.CurrentDomain.AssemblyResolve += _AssemblyResolver;
// Close program if there is another instance running
if (!_EnsureSingleInstance())
return;
#if !DEBUG
try
{
_Run(args);
@@ -65,6 +68,9 @@ namespace Vocaluxe
MessageBox.Show("Unhandled error: " + e.Message + stackTrace);
CLog.LogError("Unhandled error: " + e.Message + stackTrace);
}
#else
_Run(args);
#endif
_CloseProgram();
}