Global.asax not firing for Release build

时光毁灭记忆、已成空白 提交于 2019-11-27 15:45:27

We had this problem and a missing PrecompiledApp.config file was the solution. Without it global.asax events did not fire under IIS6 using an ISAPI filter and the rewritten.aspx approach documented e.g. on blog.codeville.net. We use msbuild to precompile the site before deploying.

We scratched our heads over this one for a couple of hours when our builds stopped working. Turns out while in obsessive house-keeping mode I had removed this file from source control as I thought it was redundant. Adding it back in fixed the problem.

If you are publishing the app, then do check for PrecompiledApp.config file. If you remove that file from the published site folder, the events would stop firing.

I would make sure that the logging logic is not running into some sort of a permission issue while logging null reference exceptions. Do you have the approprite permissions to access where the log is being written?

If you need to avoid PrecompiledApp file and publish Global.asax, please go to Publish and move to setting tab at bottom and uncheck the precompile during publishing.

Belove image will be help you

Devraj Gadhavi

We tried a lot of things.

  1. Global.asax is not publishing and event are not firing in Global.asax
  2. Why are the Global.asax events not firing in my ASP .NET website?
  3. global.asax works on local computer but not after i publish to server
  4. Mystery of Global.asax in ASP.NET MVC application

We also tried putting the below files in root and bin directories.

  1. App_global.asax.dll and App_global.asax.compiled files
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!