DEV Community

Guido Zambarda
Guido Zambarda

Posted on • Originally published at iamguidozam.blog on

A wild SocketException appeared!

Today I was debugging an old web API project and suddenly an error appeared:

SocketException: An attempt was made to access a socket in a way forbidden by its access permissions.
Enter fullscreen mode Exit fullscreen mode

I tried restarting Visual Studio but the error remains…considering that I didn’t change anything from the previous debugging session I decided to ask the web and after a little while searching I discovered a simple solution.

In my case what I needed was to start a PowerShell session with administrative privileges and run the following commands:

net stop hns
net start hns
Enter fullscreen mode Exit fullscreen mode

Et voila! I got my debugging session up and running!

Hope that helps!

Top comments (0)