"Unable to connect to web server 'IIS Express'"

Viewed 12357

.NET CORE 1.1 application, normally works and runs on localhost:5000. Sometimes I start getting the title error, and then I have to reboot my machine. I think I might have tracked it down somewhat to Docker now using port 5000. So I stopped docker figured that would be it. But I keep getting the same error. Resource monitor shows that port 5000 is in use by pid 4 'System'. I've killed the IIS processes and the port disappears. Then when I run my app again I keep getting the same error. I can restart VS (both 2015 and 2017) and use different ports, but I keep getting the error until I reboot.

Is there some way to recover from this without a reboot?

3 Answers

In the Project properties, try changing the port number to something different:

enter image description here

After tried many options. Finally I have restarted my machine and it works.

Related