private static void Restart(string reason) { BeforeRestarting?.Invoke(); Log.Info($"Restart by '{reason}'"); Log.Close(); using (Process p = new Process()) { p.StartInfo = new ProcessStartInfo( Process.GetCurrentProcess(). MainModule.FileName); p.Start(); }; Application.Exit(); }
private static void Restart(string reason) { BeforeRestarting?.Invoke(); Log.Info($"Restart by '{reason}'"); Log.Close(); using (Process p = new Process()) { p.StartInfo = new ProcessStartInfo( Process.GetCurrentProcess(). MainModule.FileName); try { p.Start(); } catch (Win32Exception ex) { Log.Warn("Restart failed", ex); } } Application.Exit(); }