namespace DNFLoadout; internal static class Program { private static readonly string LogPath = Path.Combine(AppContext.BaseDirectory, "startup.log"); private static void Log(string text) { try { File.AppendAllText(LogPath, $"{DateTime.Now:O} {text}\r\n"); } catch { } } [STAThread] private static void Main() { AppDomain.CurrentDomain.UnhandledException += (_, e) => Log("UNHANDLED " + e.ExceptionObject); Application.ThreadException += (_, e) => Log("THREAD " + e.Exception); Log("start"); try { ApplicationConfiguration.Initialize(); Application.Run(new MainForm()); Log("exit"); } catch (Exception ex) { Log("FATAL " + ex); throw; } } }