diff --git a/Discord Media Loader.Application/Classes/Core.cs b/Discord Media Loader.Application/Classes/Core.cs
index 1f9d25b..2a458b3 100644
--- a/Discord Media Loader.Application/Classes/Core.cs
+++ b/Discord Media Loader.Application/Classes/Core.cs
@@ -34,8 +34,10 @@ namespace DML.Application.Classes
public static async Task Run(string[] paramStrings)
{
+#if !DEBUG
try
{
+#endif
var splash = new FrmInternalSplash();
splash.Show();
System.Windows.Forms.Application.DoEvents();
@@ -256,16 +258,19 @@ namespace DML.Application.Classes
Logger.Info("Stopping scheduler...");
Scheduler.Stop();
+#if !DEBUG
}
catch (Exception ex)
{
+
Logger.Error($"{ex.Message} [{ex.GetType().Name}] occured at: {ex.StackTrace}");
if (MessageBox.Show($"An error occured while running Discord Media Loader:\n{ex.GetType().Name}: {ex.Message}\n\nDo you aggree to sending the error report to the creator of the tool?", "Discord Media Loader", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
Raven.Capture(new SentryEvent(ex));
}
}
- }
+#endif
+ }
private static Task Client_Connected()
{
diff --git a/Discord Media Loader.Application/DML.Application.csproj b/Discord Media Loader.Application/DML.Application.csproj
index 9318e39..efdc45f 100644
--- a/Discord Media Loader.Application/DML.Application.csproj
+++ b/Discord Media Loader.Application/DML.Application.csproj
@@ -19,27 +19,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- all
-
-
diff --git a/Discord Media Loader/Discord Media Loader.csproj b/Discord Media Loader/Discord Media Loader.csproj
index 97979f1..f23e34d 100644
--- a/Discord Media Loader/Discord Media Loader.csproj
+++ b/Discord Media Loader/Discord Media Loader.csproj
@@ -20,24 +20,9 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- all
-
+
\ No newline at end of file
diff --git a/Discord Media Loader/Program.cs b/Discord Media Loader/Program.cs
index 69f455d..bd3a4bc 100644
--- a/Discord Media Loader/Program.cs
+++ b/Discord Media Loader/Program.cs
@@ -1,6 +1,7 @@
using System;
using System.Windows.Forms;
using DML.Application.Classes;
+using Nito.AsyncEx;
namespace Discord_Media_Loader
{
@@ -22,7 +23,7 @@ namespace Discord_Media_Loader
private static void DoLaunch(string[] paramStrings)
{
- Core.Run(paramStrings);
+ AsyncContext.Run(() => Core.Run(paramStrings));
}
}
}