Execution before HttpApplication.Init RRS feed

  • Question

  • User725899269 posted

    What I'm trying to do is get a piece of code to run before Global.asax's Application_Start().  My requirement is that I can only modify web.config but I can add assemblies to bin.

    http://msdn.microsoft.com/en-us/library/ms178473.aspx this page seems to indicate that all IHttpModules implementers registered in web.config will be created after HttpApplication, but before the call to Init().

    This looked like the perfect solution, run my code from the constructor of an IHttpModule, but alas it appears that MSDN page is incorrect and my module isn't created until AFTER Init() is called.

    Any other suggestions?  Any way I can get code to run at the time of parsing web.config?



    Thursday, December 21, 2006 4:28 PM


  • User725899269 posted

    I've found a solution should anyone else be trying to do something similar.

    Look into the BufferedWebEventProvider class.  The ApplicationStart event is passed to HealthMonitors before application_start is called.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 21, 2006 6:16 PM