views:

52

answers:

1

I'm implementing a custom ASP.NET MVC controller factory.

I wonder when the ReleaseController method is called? Is it the same time as EndRequest?

+2  A: 

This is happens when EndProcessRequest(IAsyncResult asyncResult) method of MvcHandler class is called.

asyncResult contains delegate wich been prepared by

IAsyncResult BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, object state)

method of same class wich contains factory.ReleaseController(...); call.

This is happens before Application_EndRequest (in Global.asax) is called.

er-v