17

I have MVC4 web application project in visual studio 2010. When I want to start it, I have the following error:

Unable to launch the IIS Express Web server: Port"80" is in use.

The problem came after changing the property "Use Local IIS Webserver"

Nivya
  • 333
  • 3
  • 4
  • 13

8 Answers8

13

http://blog.lextudio.com/2012/10/port-already-in-use-then-who-uses-it/

If you already have something monitoring port 80 (such as full IIS), then you cannot use another thing to monitor the same port.

Thus, if you do want to use IIS Express, make sure in Project Url: field you specify another port number other than 80.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • I gave project url as **http://http://localhost/ConQuery** Then where I give The port number? – Nivya Mar 04 '14 at 07:09
  • I gave project url as http://http://localhost/MyProjectName Then where I give The port number? – Nivya Mar 04 '14 at 09:13
  • localhost:port is what you should have learnt. As you specify no port in the past, it means port 80 is used. That perfectly matches the error you meet. – Lex Li Mar 04 '14 at 12:52
  • Look in .sln file root ->.vs/config/applicationhost.config directory and remove the binding element from your project section. Something like this – jwize Apr 30 '17 at 00:07
  • 1
    Alternatively, if IIS is indeed running and serving on port 80, start IIS manager, right-click the head node in the connections window, and click "stop". – Protector one Nov 13 '17 at 13:43
7

In VS 2013:

Go to your Web Project Properties, Web Tab.

Select "IIS Express" from the dropdown.

Enter a project URL, such as http://localhost:64510/

If you have "Override application root URL" checked, uncheck it.

live-love
  • 48,840
  • 22
  • 240
  • 204
4

The port is probably in use. I usually end the iisexpress.exe. This works if for some reason the port is open and you want to close it.

CTRL+ALT+DEL -> Task Manager ->End process for iisexpress.exe

Dip
  • 343
  • 7
  • 22
4

I just had this happen to me, and didn't understand why as everything had worked fine until restarting my machine. Seems that the full IIS service was running, but only within the manager had it been STOPPED, so when I restarted it turned back on.

FIX IT THIS WAY:
Open up the Internet Information Services (IIS) Manager (use search programs and files, too. See image)

enter image description here

Right click on localhost (top level, left pane), select STOP. Not called 'localhost'? This will probably be called your machine name, but if you hover over the top level on the left pane, you should see 'https://localhost/'. This is what you want. Right click and select STOP.

Now, this is assuming you only want to run IIS Express sites, as anything that required the full IIS won't be running. You should be good to go!

RichieMN
  • 905
  • 1
  • 12
  • 33
4

If IIS is running and you are using IIS Express you should stop IIS for it to work.

1

Such error can appear when YourApp.csproj file contains conflicted settings.

<!-- conflicted settings -->
<UseIISExpress>true</UseIISExpress>
...
<IISUrl>http://localhost/application/</IISUrl>

If you want to use IIS Express you should change IISUrl to http://localhost:11222/ or another free port.

<!-- settings for IIS Express -->
<UseIISExpress>true</UseIISExpress>
...
<IISUrl>http://localhost:11222/</IISUrl>

If you want to use IIS you should set UseIISExpress to false.

<!-- settings for IIS -->
<UseIISExpress>false</UseIISExpress>
...
<IISUrl>http://localhost/application/</IISUrl>
Neshta
  • 2,605
  • 2
  • 27
  • 45
1

Sql Server could also be the culprit. I stopped Sql Server and it freed up the port.

0

Another answer does mention this, however, if you're using IIS Express within Visual Studio AND have IIS enabled in Windows Features; It will be the "Default IIS Site" that is using port 80. Simple open IIS and stop the site running by right-clicking on the top node.

rhys_stubbs
  • 538
  • 6
  • 16