I have some code in my Blazor server app that, I believe, runs when IIS shuts down (via IDisposable). Is there a way, when running under the Visual Studio debugger, to have it perform the shutdown notifications/operations that occur when running on Azure App Server and it gently shuts down there?
Try this
app.Lifetime.ApplicationStopping.Register(() => Console.WriteLine("Stopping"));
in program.cs
and then use Ctrl-C in the console that is running the app, it triggers a shutdown and runs that code.