Assuming that you are using default port:
this usually happens when a process gets corrupt and is disconnected from visual studio.
If you are on mac, open activity monitor and kill the process by name "dotnet"
If you are using a non standard port: then you need to change the port number to an available one. There is a solution from Amit on this thread, use that to change the port.