Prashanth Prashanth - 1 year ago 150
ASP.NET (C#) Question

Application_Start() & Application_End() methods are not fired in startup.cs class in MVC 5

There is no Global.aspx.cs class in ASP.NET MVC 5 application where I can have the methods


Is there any way to invoke these methods in MVC 5 application?

Answer Source

You can manually add Global.asax to your project as mentioned here.

Otherwise, you can use Configuration(IAppBuilder app) or constructor in your Startup.cs. Configuration is called "slightly later" than Application_Start as mentioned in detail here.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download