This is just another "working in dev server, why not working in IIS" type question.
I created a nice DAL using NHibernate as described here. When creating an ISession, I hook up an event handler to the HttpApplication.EndRequest to take care of cleaning it up.
However, I deployed my site to IIS and it says:
Event handlers can only be bound to HttpApplication events during IHttpModule initialization.
I completely understand what the message is saying, but I can't undestrand why.
I can subscribe to a Button
's event in any time, why can't I subscribe to an event of the HttpApplication
?
I would be very grateful if someone could shed some light on this.
And I also wonder, why is it working with the development server and not with IIS 7?
EDIT:
Now that two months has passed, I still haven't received any useful answers. :(
Is this issue really that hard?