为什么通过 IHttpHandler 调用 IHttpAsyncHandler?
我创建了一个派生自 MvcHandler 的自定义处理程序。我的路由使用自定义 RouteHandler,它返回 GetHttpHandler() 的新处理程序,并且我在自定义处理程序中重写 ProcessRequest()。对 GetHttpHandler 的调用正在触发断点,并且肯定会调用我的处理程序的构造函数,但在基础 MvcHandler 上调用 BeginProcessRequest(),而不是 ProcessRequest()。
当我没有执行任何操作来调用异步方法时,为什么会调用它们?我不想要异步处理,而且我当然没有做任何明确的事情来获得它。我的控制器都派生自 Controller,而不是 AsyncController。
我现在没有源代码,但如果需要的话我可以稍后添加。我希望有人可能知道在不需要时可能会调用 BeginProcessRequest 的一些原因。
I made a custom handler that derives from MvcHandler. I have my routes using a custom RouteHandler that returns my new handler for GetHttpHandler(), and I override ProcessRequest() in my custom handler. The call to GetHttpHandler is triggering a breakpoint and my handler's constructor is definitely being called, but BeginProcessRequest() is being called on the base MvcHandler instead of ProcessRequest().
Why are the async methods being called when I haven't done anything to call them? I don't want asynchronous handling, and I certainly didn't do anything explicit to get it. My controllers all derive from Controller, not AsyncController.
I don't have the source code with me right now, but I can add it later if needed. I was hoping someone might know some of the reasons why BeginProcessRequest might be called when it's not wanted.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Brad Wilson 在 Asp.net 论坛上回复了我的帖子,答案如下 http://forums。 asp.net/t/1547898.aspx:
听起来 ProcessRequest 甚至不再被调用,但我可能弄错了。我可以说我在测试中没有看到它。
Brad Wilson responded to my post on the Asp.net forums with the following answer http://forums.asp.net/t/1547898.aspx:
It sounds like ProcessRequest is not even called anymore, but I could be mistaken. I can say that I haven't seen it in my testing.