5

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

user1755802
  • 81
  • 1
  • 6

2 Answers2

1

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

Dunc
  • 18,404
  • 6
  • 86
  • 103
0

I had the same problem.The CreateWebHostBuilder method in Program class look liked this:

 public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .UseKestrel()
                .UseStartup<Startup>();

then I realized the problem is with .UseKestrel().The Kestrel documentation said CreateDefaultBuilder calls UseKestrel behind the scenes.so, I removed this extension method and the problems gone!.

fbarikzehy
  • 4,885
  • 2
  • 33
  • 39