how to catch exit signal in asp.net core on linux?
问题 I am writing a c# console app base on net core 3.1 linux It was expected to run job async await job end catch the kill signal and do some clean job here is my demo code: namespace DeveloperHelper { public class Program { public static async Task Main(string[] args) { var http = new SimpleHttpServer(); var t = http.RunAsync(); Console.WriteLine("Now after http.RunAsync();"); AppDomain.CurrentDomain.UnhandledException += (s, e) => { var ex = (Exception)e.ExceptionObject; Console.WriteLine(ex