Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking.UvException: 'Error -4092 EACCES permission denied'

I am using TFS source control. Today, after I updated code and ran the project, I encountered this error:

This is my capture image

I am using Visual Studio 2017. My project is Web API .NET Core 2.0. And this is the error detail:

Error Detail

like image 402
Khoa Nguyen Anh Avatar asked Sep 18 '25 18:09

Khoa Nguyen Anh


1 Answers

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.

like image 88
Siy Williams Avatar answered Sep 21 '25 10:09

Siy Williams