I would like to use Application_End and Application_Error for logging, but have no global.asax file?

599 Views Asked by At

I am trying to write some logging for unexspected session losses, i'm unsure if its a timeout issue or something is cuasing me to loss my sessions.

Following this questions answer ASP.NET SessionState timeout I would like to write my logging in the Application_End and Application_Error sections, but i am unable to find my global.asax file.

The file or Application_End and Application_Error have not show up in my search.

How can i find my global.asax file or Application_End and Application_Error sections, or where else could i log to record the loss of sessions?

Thanks in advance.

1

There are 1 best solutions below

2
Varun Sharma On

Can you check whether you are using the right project template? Web Application Template or Website Template.

If global.asax file is not there , you can add it manually.

Follow the step by step instruction provided here and you will be able to do so

http://www.aspdotnet-suresh.com/2011/05/how-to-add-globalasaxcs-file-in-aspnet.html