[英]ASP.NET Web Api. Controller not hit. No response at all. Approaches to diagnose?
I have a controller method which was previously working and it's not clear what change, if any, has caused the following problem: 我有一个以前工作的控制器方法,并不清楚是什么改变,如果有的话,导致了以下问题:
The controller is not hit. 控制器没有命中。 There is no exception, no response, no status code or indeed any response from the server (checked in Fiddler).
没有异常,没有响应,没有状态代码或实际上来自服务器的任何响应(在Fiddler中检查)。 The request eventually times out.
请求最终超时。
UPDATE UPDATE
See my answer below. 请参阅下面的答案。 Also see my follow up question:
另请参阅我的后续问题:
Web API Controller method executes to end. Web API Controller方法执行结束。 No HTTP response.
没有HTTP响应。 Hangs
挂起
Is your project under source control? 您的项目是否受源代码管理? You mention that it was previously working.
你提到它以前工作。 If you're under source control you may be able to rollback changes to your controller, test and isolate the change that caused the problem.
如果您受源代码控制,则可以将更改回滚到控制器,测试并隔离导致问题的更改。
Another thing to check would be changes to routing. 要检查的另一件事是路由更改。 Perhaps your controller hasn't changed, but something with routing did.
也许你的控制器没有改变,但有路由的东西。 Routing can be tricky, there are some tools to help.
路由可能很棘手,有一些工具可以提供帮助。 A quick Google search came up with this:
一个快速的谷歌搜索提出了这个:
https://blogs.msdn.microsoft.com/webdev/2013/04/04/debugging-asp-net-web-api-with-route-debugger/ https://blogs.msdn.microsoft.com/webdev/2013/04/04/debugging-asp-net-web-api-with-route-debugger/
I haven't used it myself, but I may in the future as I've run into routing problems before. 我自己没有使用它,但是我可能在将来遇到路由问题。
This problem appears to be an artefact of the actual problem; 这个问题似乎是实际问题的假象; which appears to be that the browser/middleware/web-app are queuing the requests and previous hung requests are causing the behaviour described eventually noticed to be 'waiting for available socket...')
这似乎是浏览器/中间件/ web-app对请求进行排队,之前的挂起请求导致最终注意到的行为是“等待可用的套接字......”)
What happens in a clean room situation is slightly different (the controller method executes to the end and returns a result, however there is no HTTP response) and warrants a new question, see Web API Controller method executes to end. 在洁净室情况下发生的情况略有不同(控制器方法执行到最后并返回结果,但没有HTTP响应)并保证一个新问题,请参阅Web API Controller方法执行结束。 No HTTP response.
没有HTTP响应。 Hangs
挂起
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.