Cannot start IIS Express

27

I has just installed Visual Studio 2012 and wanted to create my first WCF Service Application. I am a Java developer coming to .NET world, so please be understanding :)

I have created a new C# project WCF Service Application. Then I hit Debug (or F5) and I get an error saying:

Unable to launch IIS Express

When I click again there is another error like this, but this time IIS appears in tray and I get a notification (bubble) and when I click it there is a message saying:

Port '53234' is already being used by process 'IIS Express' (process ID '5524')

I have tried changing the port in project properties in Web tab, but it does not change anything. The msgs are the same, just the port number changes.

For me this is quite funny, but I cannot fix it. Already tried changing the ports, I reinstalled IIS, restarting Visual Studio and PC. Nothing is running on the ports that I want to use.

I am using Windows 8.1 x64, Visual Studio 2012 (IIS 8).

EDIT

There is a log msg in IIS:

Failed to register URL "http://localhost:53234/" for site "WcfService1" application "/". Error description: Cannot create a file when that file already exists. (0x800700b7)
Registration completed
c#
wcf
iis
visual-studio-2012
asked on Stack Overflow Feb 24, 2014 by BartoszCichecki • edited Feb 24, 2014 by BartoszCichecki

7 Answers

36

For me this problem was due to a misconfiguration in the project which manifested itself in IISExpress' applicationHost.config file.

I had both the http and https ports setup as the same.

            <site name="{projectname}" id="3">
            <application path="/" applicationPool="Clr4IntegratedAppPool">
                <virtualDirectory path="/" physicalPath="{myPath}" />
            </application>
            <bindings>
                <binding protocol="https" bindingInformation="*:57287:localhost" />
                <binding protocol="http" bindingInformation="*:57287:localhost" />
            </bindings>
        </site>

To solve this edit the project file to correctly use different ports.

Another option is to delete the applicationHost.config file, Visual Studio will recreate it when it fires up IISExpress. It won't solve a project misconfiguration but it might solve a currupt configuration which I've had to do a few times.

*Note: * To find your applicationHost.config file for IIS see this question Where is the IIS Express configuration / metabase file found?

answered on Stack Overflow Jun 8, 2016 by Mike Mengell • edited May 23, 2017 by Community
12

I was facing the same issue and what I did is as follow:

  • Go to Project Properties -> Web
  • Change the port number and click on Create virtual directory button

Now you will be able to run the application without any error.

answered on Stack Overflow Dec 12, 2017 by Vaibhav
10

I ran into this recently and my solution wasn't here, so I figured I'd add it.

My issue was that netsh had a urlacl added that matched my localhost binding, causing this error message.

The solution is to call netsh http show urlacl and look and see if your iis express binding are listed. My localhost binding was for https://localhost:44300. So to fix it, I had to call:

netsh http delete urlacl url=https://localhost:44300/

answered on Stack Overflow Jul 28, 2016 by mccow002
4

I encountered this issue when I had two instances of Visual Studio 2012 open with different projects that happened to have the same name (default name of App).

I was able to resolve this by closing one instance of Visual Studio.

answered on Stack Overflow Apr 19, 2016 by Tristan Reischl
2

The root cause of the problem for me was that I had a website running in Local IIS which was bound to the same port as the one I was trying to start up via Visual Studio's IIS Express. The Visual Studio debugger would start up, and everything would look fine, but no dlls were loaded and the memory graph was just a flat line at 13[MB] no matter what I did on the website (which was actually the version being served by Local IIS).

So, I just needed to change one of the port numbers.

answered on Stack Overflow May 17, 2019 by N73k
1

I tried netsh http show urlacl and didn't see my address, my applicationHost.config file looked correct, and there was nothing troubling inside IIS. I fixed it by closing Visual Studio, deleting the .vs directory out of the solution folder, and restarting Visual Studio.

answered on Stack Overflow May 28, 2019 by sirdank
0

For me this happened only (in visual studio 2019) when I did Ctrl+F5 (start without debugging) but had no problems when debugging. @Mike Mengells answer put me on the right track. In my project properties I switched "SSL Enabled" from true to false and all was good :)

answered on Stack Overflow Apr 9, 2021 by Bjarki B

User contributions licensed under CC BY-SA 3.0