0

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;
 }
Yuriy Anisimov
  • 825
  • 1
  • 7
  • 16
  • 1
    I found - what was the problem! When i was exploring my web.config file, i saw the following parameter: system.webServer->modules runAllManagedModulesForAllRequests="false" When i switch on runAllManagedModulesForAllRequests - HttpApplication events start working. – Yuriy Anisimov Jun 02 '12 at 11:17

2 Answers2

2

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.

Guillaume Schuermans
  • 906
  • 2
  • 12
  • 28
0

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

Community
  • 1
  • 1
Yuriy Anisimov
  • 825
  • 1
  • 7
  • 16