Visual Studio - Unable to launch the IIS Express Web server

I run into this error on occasion, more often on old websites.

Failed to register URL "http://localhost:{PortNumber}" for site {SiteName} application "/". 
Error description: The process cannot access the file because it is being used by another process. 
(0x80070020)

My first go-to, if it isn't too much trouble, has been to restart the computer. It's quick, easy & often unlocks any files a different process is using.

Another method I had recent luck with is to try and restart the WinNAT service.

net stop winnat

net start winnat

This has fixed my issues even after restarting Windows wouldn't. Restarting WinNAT will cause Windows to release ports that it's locking from use.

One Last Thing...

If you have a question or see a mistake, please comment below.

If you found this post helpful, please share it with others. It's the best thanks I can ask for & it gives me momentum to keep writing!

Matt Ferderer
Software Developer focused on making great user experiences. I enjoy learning, sharing & helping others make amazing things.
Let's Connect