How to free port on Windows?
So… All worked well, you were testing your website locally on some port and then suddenly it stopped working and you got an error that this URL can not be visited because this port is in usage. Can happen also if you have Angular local website, .NET local website in development…
So, how you can get rid of this?
Usually, these three commands will help you (in example is port 4200 – replace it with your own):
- net stop winnat
- netsh int ipv4 add excludedportrange protocol=tcp startport=4200 numberofports=1
- net start winnat
Second command just put your port (4200 in this example) in excluded list, so it will be not used by any app.
You can just say “Thanks” or buy me one beer 🙂