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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay