How do I get the shutdown reason in ASP.NET Core 5?

Marius A 26 Reputation points
2021-10-31T07:35:51.283+00:00

In older versions of ASP.NET you could use

HostingEnvironment.ShutdownReason 

to retrieve

ApplicationShutdownReason 

This no longer works in ASP.NET 5 Core and now I can't figure out how to get the shutdown reason. Thank you!

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,159 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,386 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,254 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,238 questions
{count} votes