Why is IHttpAsyncHandler called through IHttpHandler?

I created a custom handler that comes from MvcHandler. I have routes using a custom RouteHandler that returns my new handler for GetHttpHandler (), and I override ProcessRequest () in my custom handler. A call to GetHttpHandler calls a breakpoint, and the handler constructor is definitely called, but BeginProcessRequest () is called based on MvcHandler instead of ProcessRequest ().

Why are async methods called when I haven't done anything to call them? I do not want asynchronous processing, and of course I did nothing to get it. My controllers are from Controller, not AsyncController.

I do not have the source code with me right now, but I can add it later if necessary. I was hoping that someone might know some reasons why BeginProcessRequest can be called when it is not needed.

+3
source share
1 answer

Brad Wilson answered my post on Asp.net forums with the following answer http://forums.asp.net/t/1547898.aspx :

The short answer is yes.

With the addition of AsyncController, the MvcHandler class should be IHttpAsyncHandler, which means that with respect to the ASP.NET kernel, the execution time, entry points are now BeginProcessRequest and EndProcessRequest, not ProcessRequest.

, ProcessRequest , . , .

+2

Source: https://habr.com/ru/post/1740961/


All Articles