2

Actually, we use ASP.NET 4.5 (VS 2013) and want to replace Global.asax.cs with new Startup.cs file, which comes from OWIN specification.

We log the start and the end of application using Application_Start and Application_End handlers in this way:

protected void Application_Start(object sender, EventArgs e)
{
    _log.Info("The app starts.");
}

protected void Application_End(object sender, EventArgs e)
{
    _log.Info("The app ends.");
}

But, as I know there is no such handlers in the new Startup.cs file. So, my question is - how can we do that?

tesicg
  • 3,971
  • 16
  • 62
  • 121
  • 1
    You already know when the application is starting since Startup.cs is executing then. For the application end event have a look at this answer: http://stackoverflow.com/questions/27444924/is-there-application-end-from-global-asax-in-owin – peco Oct 05 '15 at 08:30
  • It works. Thanks. And do you happen to know what to do with Session_Start and Session_End? – tesicg Oct 05 '15 at 10:53
  • OK. If you write your answer as regular post, I'll checked it out. – tesicg Oct 05 '15 at 12:17
  • 1
    Alright, I dont know about the session events though. – peco Oct 05 '15 at 12:53

1 Answers1

0

You already know when the application is starting since Startup.cs is executing then. For the Application_End event have a look at this answer: Is there Application_End from Global.asax in Owin?

Community
  • 1
  • 1
peco
  • 3,890
  • 1
  • 20
  • 27