swit
swit

Reputation: 187

Can't use port 8080

When I'm trying to run a service (RavenDB) on port 8080 it stops and the Windows Logs show the following error:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.HttpListenerException: Failed to listen on prefix 'http://+:8080/' because it conflicts with an existing registration on the machine.

Acccording to IIS and netstat -an | find "8080" the port is currently not in use.

If I change the port to any other, the problem disappears.

Upvotes: 2

Views: 7698

Answers (1)

Phillip Ngan
Phillip Ngan

Reputation: 16106

Port 8080 may actually be in use. To replicate another answer

netstat -a only lists connected sockets and listening socket.

-a Displays all connections and listening ports. Neither connect nor listen was called on your socket, so it falls outside the purview of netstat -a.

However, since Windows 10, you can use netstat -q.

-q Displays all connections, listening ports, and bound

You could also try to view the port using tcpview from the SysInternals suite. Sort by port number. It will also tell you the process using the port, which you can then kill.

Upvotes: 1

Related Questions