3 ms·
That 'finally' clause might not run to flush Serilog at the end. The webhost will listen to several exit events but some like window close, cancel key, some exc
by manigandham 8y ago
That 'finally' clause might not run to flush Serilog at the end. The webhost will listen to several exit events but some like window close, cancel key, some exceptions, and others will close the program at soon as the event handler returns. This is why the webhost registers a ManualResetEvent to block the event handler until the Program.Main() is finished running.
Also if you're using EF migrations, then stick with the normal CreateWebHostBuilder() method in Program.cs because it's used to bootstrap the program to run migrations at the command line.