简体   繁体   English

ASP.NET Web Api。 控制器未命中。 完全没有回应。 诊断方法?

[英]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.

相关问题 ASP.NET 核心 Web API。使用 NSwag 生成的客户端未命中 PUT 端点 - ASP.NET Core Web API. The PUT endpoint is not getting hit using NSwag generated client 此断点当前不会被命中。 在项目 asp.net web forms 中没有为此文档加载任何符号 - this breakpoint will not currently be hit. no symbols have been loaded for this document in project asp.net web forms Asp.net Web Api。 将复杂模型发布到Controller且收到的模型不正确 - Asp.net Web Api. Post a complex model to Controller and received model incorrect 忽略 ASP.NET Web ZDB974238714CA8DE634A7CE1D083A14 中的 controller - Ignore controller in ASP.NET Web API 为什么在控制器操作上包含数据时日期时间值会发生变化? 使用 AngularJs 和 Asp.Net Web API 2 - Why Date time value change when contain data hit on controller action? Using AngularJs and Asp.Net Web API 2 ASP.Net自托管Web API。 验证Ajax请求,未设置Cookie - ASP.Net self-host web api. Auth ajax request, cookies doesn't set C#ASP.NET Web Api控制器 - 使用SqlCommand从表中获取所有行 - C# ASP.NET Web Api Controller - Get all rows from a table using SqlCommand 所有方法都充当ASP.NET WEB API控制器中的HTTP动词(Get,Put,Post和Delete) - All methods act as a HTTP verb (Get, Put, Post And Delete) in ASP.NET WEB API controller ASP.NET Core Web Api 控制器端点都返回 404 错误 - ASP.NET Core Web Api controller end points are all returning 404 error ASP.NET Web Api控制器发现缓存期 - ASP.NET Web Api controller discovery caching period
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM