I'm not sure what you would gain from this at all. But we are sort of lacking some information.
When you're working with IIS / System.Web hosting then you can still use the Application_End
event.
If you're self-hosting in a console then you can just include code that happens after the Console's ReadKey event is raised (or similar)
If you're using OWIN then I'm not sure what you could hook into.