ASP.NET MVC3 HttpApplication doesn't fire events like BeginRequest, EndRequest, PostAcquireRequestState

1.5k views Asked by At

ASP.NET MVC3 HttpApplication doesn't fire events like BeginRequest, EndRequest, PostAcquireRequestState etc. So it works fine but it doesn't fire events! I have tried to reinstall asp.net via aspnet_regiis - but there was no luck. Also i have tried to put events to Application_Start the same result.

I published web site via Web Deploy.

The interesting thing is - i have created new MVC project for testing purposes, deploy it and it works - HttpApplication events work perfectly.

Configuration: WINDOWS 2008R2, IIS 7.5, ASP.NET MVC 3, all updates were installed.

Any help will be appreciated. Thanks in advance!

Example of subscribtion to HttpApplication events:

public MvcApplication()
 {
    EndRequest += MvcApplication_EndRequest;
    PostAcquireRequestState += MvcApplication_PostAcquireRequestState;
    PostAuthenticateRequest += MvcApplication_PostAuthenticateRequest;
 }
2

There are 2 answers

0
Guillaume Schuermans On

There is a pretty good article on this: http://forums.asp.net/p/1306960/2572147.aspx#2572147

It should be a better solution than turning on managing of all requests by managed handlers. The latter is not very interesting for performance.

0
Yuriy Anisimov On

As you saw from my comments i found a solution, but it's not complete solution, because it should work with runAllManagedModulesForAllRequests="false", probably because i don't want, that static content will be involved in integrated pipeline - it's performance cost effective! So i found real solution thanks to Kev: Prevent IIS from serving static files through ASP.NET pipeline