I attempted to run my web service through visual studio. I faced an issue like :
---------------------------
Microsoft Visual Studio
---------------------------
I my case, I binded the application to run on LAN, i.e connect to the application from another devices like mobile. It has to run visual studio as administrator.
It worked for me.
After updating Windows 10 and/or Visual Studio 16+ it might happen due to an internal bug that IISExpress fails to register any development website because it no longer accepts localhost
connections.
To fix the issue, you just have to register again the binding. To do so, run from an administrative shell the following command:
netsh http add iplisten ipaddress=::
I had this problem when upgrading an MVC project. I copied over the newer-MVC .csproj over my existing .csproj file then worked back to a fully working Project. What I failed to consider is the existing port number in the old .csproj. The new project had a new port number, yet shared the Project/Assembly Name. That was enough to make IIS Express lose its mind and throw this exception.
Just digging the old port number out of git and changing the IIS Express URL to include it in Project Settings was enough to fix it.
From https://www.davidsalter.co.uk/unable-to-launch-the-iis-express-web-server-error-0x80070020/
Error code 0x80070020
means ERROR_SHARING_VIOLATION
, which in the case of IIS Express (or IIS) means that the port that it is attempting to listen on is being used by another process.
Use the netstat
command to find out which application is using the port.
netstat -ao | findstr <port_number_to_search_for>
The a
parameter tells netstat to display all connections and listening ports.
The o
parameter tells netstat to display the process ID associated with the connection.
Running the above netstat command will produce output such as:
C:\>netstat -ao | findstr 4026
TCP 12.0.0.1:4026 cs-pc:4026 LISTENING 9544
The last number displayed (9544 here) is the process ID.