Application On start not firing with release build in global.asax
Thursday, August 23rd, 2007This was an odd problem. When I do a build release of the solution and deploy it to the test or live server running Windows Server 2003 64bit(ahhrggg) the Application_Start method was never raised! It did though when running the release build locally on Win XP Pro. This is a bugger as all my logging is set up at this point along with a couple of timers etc.
After a bit of Googling I found that many people had the same problem. I found one possible solution which was to change the method name that is raised:
Application_Start method to Application_OnStart
This still did not fix it for me.
I found that uploading the PrecompiledApp.config in the root along with this change worked. I did have to actually restart IIS rather than just save the web.config but hay ho sometimes you’ve got to do what you’ve got to do!
It is also good to note that it is important to upload the other little files found in the bin created during a release build such as App_global.asax.compiled.