I am developing ASP.NET web application and for unhandled exception i am making use of
Global.asax file Where I wrote a logic to write the error logs as
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
'Code that runs when an unhandled error occurs
End Sub
It all works locally but when published the website global.asax not being published
still i uploaded global.asax to remote server but events are not firing
My application uses IIS 7 as a Web server
Do i need any sort of configuration Suggest if you have any solution
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
i also uploaded App_global.asax.compiled and it works
Method 2
We tried a lot of things.
- global.asax works on local computer but not after i publish to server
- Why are the Global.asax events not firing in my ASP .NET website?
- Global.asax not firing for Release build
- Mystery of Global.asax in ASP.NET MVC application
We also tried putting the below files in root and bin directories.
- App_global.asax.dll and App_global.asax.compiled files
- PrecompiledApp.config
None of it worked!
We had to put raw Global.asax instead of pre-compiled dll, in order to fire the global events, for our asp .net 2.0 website.
Hope this helps someone! Cheers! Happy coding! 😀
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0