Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.net Core Application Hanging on Requests

We have a ASP.net core 2.0 application running in .Net Framework V4.7.1 hosted in IIS using Kestrel.

The application works fine on most machines, however on when running on my machine it is really slow. I have stripped down the application to a single controller returning a string, with all but the MVC and logging middleware removed. It appears that on about the 5th get request, there is a hang of about 30 seconds before the controller action is hit. The application is not restarted, it's just hanging.

Has anyone had a similar problem? Thanks

like image 296
user1755802 Avatar asked Nov 08 '22 06:11

user1755802


1 Answers

Maybe just a browser issue (in my case Vivaldi) but I experienced a similar "hanging" problem with ASP.net core 3.1 - a couple of requests work, then I change the URL to hit some other APIs, and it hangs (eventually giving a "connection was reset" error).

Turns out that it was trying to hit http://localhost:(port) but with my SSL port, which just makes it hang. The issue was masked by the browser's URL bar, which doesn't show the protocol (http/https):

Vivaldi URL Bar

You can type https:// at the start to fix it.

Or change your browser settings to make it more obvious what's going on, e.g. Vivaldi:

enter image description here

like image 185
Dunc Avatar answered Nov 22 '22 06:11

Dunc