/// <summary> /// Raises the <see cref="Application.Exit" /> event. /// </summary> /// <param name="e">An <see cref="ExitEventArgs" /> that contains the event data.</param> protected override void OnExit(ExitEventArgs e) { this.logger.LogInformation("Exiting the application with exit code '{0}'", e.ApplicationExitCode); TunnelRelayStateManager.SaveSettingsToFile(); TunnelRelayStateManager.ShutdownTunnelRelayAsync().ConfigureAwait(false).GetAwaiter().GetResult(); }