VS 2017 always times out debugging an MVC Core web

2020-07-03 07:36发布

问题:

On a plain vanilla, scaffolded ASP.NET Core MVC web app, with a DbContext registered in the DI container, whenever I hit F5 after 30-60 seconds, I get the error message:

Unable to start program 'http://localhost:60175/'. Operation timed out.

The home page in an index view, whose action gets all employees from a localhost SQL Server db. The project is already built, so the initial build for debug is quite quick, and doubtfully the cause of the delay.

If I run without debugging, I get the home page up in 30 - 40 seconds.

Just what is timing out, and can I set that timeout? Or is there anything else I can to to speed up this painfully slow debugging setup, compared to MVC 5, where the home page opens after only a few seconds.

回答1:

It is hard to say if it is the same issue, but I had same symptoms when I was starting my current project. In my case, I found I either had to:

  • Turn off Browser Link; or
  • Use a browser other than Chrome as the startup browser.

It wasn't until I selected Microsoft Edge as the browser in the debug button of the toolbar and it worked fine that I realised what it might be, and I disabled Browser Link. It all starts up fine now.

If it is yet another issue, then best of luck.