简体   繁体   中英

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM