AppCenter to AppInsights migration. (#562)

* Remove AppCenter usage and libraries.

* Remove redundant pacakges and add the app insights sink.

* Diagnostic id support and manipulating telemetries.

* Handling of appdomain unhandled exceptions.

* Remove unused package identity package from mail project.

* Fixing printing.
This commit is contained in:
Burak Kaan Köse
2025-02-16 01:44:41 +01:00
committed by GitHub
parent f0e513bf0d
commit c1336428dc
27 changed files with 160 additions and 134 deletions

View File

@@ -192,6 +192,7 @@ namespace Wino.Server
AppDomain.CurrentDomain.UnhandledException += ServerCrashed;
Application.Current.DispatcherUnhandledException += UIThreadCrash;
TaskScheduler.UnobservedTaskException += TaskCrashed;
// Ensure proper encodings are available for MimeKit
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
@@ -241,9 +242,9 @@ namespace Wino.Server
}
}
private void TaskCrashed(object sender, UnobservedTaskExceptionEventArgs e) => Log.Error(e.Exception, "Task crashed.");
private void TaskCrashed(object sender, UnobservedTaskExceptionEventArgs e) => Log.Error(e.Exception, "Server task crashed.");
private void UIThreadCrash(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) => Log.Error(e.Exception, "UI thread crashed.");
private void UIThreadCrash(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) => Log.Error(e.Exception, "Server UI thread crashed.");
private void ServerCrashed(object sender, UnhandledExceptionEventArgs e) => Log.Error((Exception)e.ExceptionObject, "Server crashed.");