简体   繁体   中英

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). The request eventually times out.

UPDATE

See my answer below. Also see my follow up question:

Web API Controller method executes to end. No HTTP response. 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/

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...')

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. No HTTP response. Hangs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM