News for hackers. Stuff that matters.
Re:Tips and Tricks for Asp.net Core Applications by manigandham on Wednesday March 06, 2019 @11:50AM (#19320332)
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.

There are no comments on this comment yet.