Thursday, March 8, 2012

Deployment of Global.asax

This week i encountered a strange issue related to ASP.NET global.asax deployment. I had a precompiled asp.net website deployed in production in which i had global.asax but the code written in glabal.asax was not getting executed in the production even if i had App_global.asax.dll in bin directory. After some attempts i found out that unknowningly i was ignoring the meta files and it is necassary to publish following file along with the /bin/App_global.asax.dll otherwise App_global.asax.dll does not work.
  1. /PrecompiledApp.config: Indicates wether the precompiled site is updatable or not.
  2. /bin/App_global.asax.compiled: Placeholder file for routing the request to global.asax to app_global.asax.dll assembly.

3 comments:

eilat city said...

you are a genius! i have been working on this for two days now... thanks

Michal Rudinec said...

Great, thank you very much :)

Deepika said...

Hi Anil,
You really saved my time, I wasted almost two days.
we have .net 2.0 application when i hosted this application one IIS7 windows 32bit machine error handling is working with out App_global.asax.dll , it was having only App_global.asax.compiled.dll not Sure why it was working there, when i hosted the application on .net prod box which is 64bit machine with IIS 7.5 it didn't work after checking your post i tried it. It stared working.
I have two questions here
1. We have web deployment folder by changing solution configurations (UAT,Prod) if we build the solution it will copy filed to the related folders from there we are copying files the production with this process it didn't copy App_global.asax.dll. then i used publish option then it copied the file. I want to know what we need to change to work with previous method
2. Why it working with out App_global.asax.dll in IIS7.

Please clarify me these two question.

Thanks ad lot sir