Click here to Skip to main content
16,016,760 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my web application, i cant get the events in Global.asax file to fire on my server. However the same Global.asax works fine on my development machine. I am using IIS 8 server and my target framework is 4.0.
I've tried a lot of different settings with the application pool and I still cant get it to work. Global.asax contains application_error handler. This application_error is not firing. For testing purpose, i added msg display in the application_start event to check whether its firing the events in global.asax , but its not calling any events in global.asax

What I have tried:

I have tried the following things
1) Rebooting the machine/server
2)Adding 'runAllManagedModulesForAllRequests="true"' into modules header in web.config.
3)Copied the local app_code.dll, app_code.compiled and globax.asax.dll and global.asax.compiled from local to server.
4)Tried with precompiled settings and registered the precompiled.config in server
Posted
Updated 16-Apr-20 23:54pm
Comments
DerekT-P 17-Apr-20 4:15am    
er.. how on earth do you do a message display in asynchronous, headless code (i.e. global.asax)?? How do you know the application_error event is not firing? (Maybe whatever you're trying to do to "display" a message is causing an error that is causing global.asax to not function at all...). In these situations I tend to write a log message to d/b or a flatfile (after making sure the IIS user has write permissions on the appropriate directory) and debug that way.
Member 14804616 17-Apr-20 5:59am    
You are right.. I got different error when i try to display the message from application_start event. I removed the message display and added my error handling snippet in the application_error event, compiled and then pushed it into the server. Again Global.asax events are not firing(Even i wrote a snippet to log the message) can you help me out? I am newbie and I don't know much about the web deployment.
DerekT-P 17-Apr-20 9:30am    
I'd suspect that you may not have "write" permissions to the folder; by default on a hosted server you won't. Suggest you post your code here, but first do something even simpler than writing a log entry: in your application_start event do Application["debug"]="yep, this fires fine"; and then in any other page, display the value of Application["debug"]. That should satisfy you that events are firing OK. If you still have problems, then by all means come back here with your code, what you expect to happen, and what is actually happening.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900