问题
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
回答1:
i also uploaded App_global.asax.compiled and it works
回答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! :D
来源:https://stackoverflow.com/questions/12890068/global-asax-is-not-publishing-and-event-are-not-firing-in-global-asax