I am using TFS source control. Today, after I updated code and ran the project, I encountered this error:
I am using Visual Studio 2017. My project is Web API .NET Core 2.0. And this is the error detail:
We had this issue recently, turned out that the port the Kestrel server was trying to use had somehow now fallen within an excluded port range.
You can view what port ranges have been excluded by running the following in command prompt
netsh interface ipv4 show excludedportrange protocol=tcp
Once we realised the cause we did try to delete the range we wanted to use using the following (in elevated Administator command prompt)
netsh int ip delete excludedportrange protocol=tcp numberofports=100 startport=49909
This however resulted in an Access Denied
.
There doesn't seem to be a way to find out the owner of the excluded port range, however in my instance it was Hyper-V. Once I turned Hyper-V off the ports were released and I could then debug in Visual Studio.
When I re-enabled Hyper-V (because I need it), it registered a different set of port ranges that do not effect the Kestrel server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With