Unable to launch the IIS Express Web server, Faile

2019-01-12 16:54发布

Some web projects are causing me problems while others work fine. I decided to focus on one of the problematic ones. I'm using Visual Studio 2013 on Windows 7. I think I'm running it as administrator, the window title says PROJECT NAME - Microsoft Visual Studio (Administrator).

When I try to run the project I get a popup saying:

Unable to launch the IIS Express Web server.

Failed to register URL "http://localhost:62940/" for site "SITE NAME"
application "/". Error description: Access is denied. (0x80070005).

This does not seem entirely uncommon but I have tried many of the suggestions without luck:

  1. Deleted %userprofile%\Documents\IISExpress\, tried to run.

  2. netsh http add urlacl url=http://localhost:62940/ user=everyone, rebooted and tried to run. (Actually user=Alla since Swedish Windows).

  3. netsh http delete urlacl url=http://localhost:62940/, rebooted and changed from <binding protocol="http" bindingInformation="*:62940:localhost /> to <binding protocol="http" bindingInformation="*:62940:/> in %userprofile%\Documents\IISExpress\config\applicationhost.config and tried to run. (It did changed the error message to say ... URL "http://*:62940/" ....

  4. Reinstalled IIS 8.0 Express

  5. Reinstalled Visual Studio 2013

I'm at my wit's end, what am I doing wrong?

Edit 1: If I change the port of the project (e.g. to 55555) it starts... This is not a desirable solution since these projects are worked on by several people. Maybe the port is blocked by something else? If so, is there an easy way to check by what?

Edit 2: Port 62940 seems to be free. Running netstat does not show any application listening to it. Something else must be wrong.

Edit 3: I tried starting the project today after not touching it for a few months. It worked but I don't know why.

30条回答
我只想做你的唯一
2楼-- · 2019-01-12 17:23

I ended up with cleaning the project file (csproj) and the applicationhost.config (iis express) with all entries regarding iis express configuration. After that, it worked.

查看更多
Fickle 薄情
3楼-- · 2019-01-12 17:26

This happened with me when I was trying to access my site from a remote location:

At first, applicationhost.config (VS2015) contained the standard:

<binding protocol="http" bindingInformation="*:64376:localhost" />

In order to access my site from a remote location within the network, I added (step 1):

<binding protocol="http" bindingInformation="*:64376:192.168.10.132" />

Then, I entered into CMD with Admin rights (step 2):

netsh http add urlacl url=http://*:64376/ user=Everyone

As step 3, I added it a rule to the firewall.

netsh advfirewall firewall add rule name=”IISExpressWeb” dir=in protocol=tcp localport=64376 profile=private,domain remoteip=localsubnet action=allow

Then, I got this error when trying to run the solution again.

Solution: I seemed to have done everything right, but it did not work until I ran netsh also for the existing localhost rule:

netsh http add urlacl url=http://localhost:64376/ user=Everyone

Now, it works again.

查看更多
Lonely孤独者°
4楼-- · 2019-01-12 17:26

I write it for information.

Delete the file in the project.

After Clean>Build>Proje Start

查看更多
在下西门庆
5楼-- · 2019-01-12 17:27

The ideal way to sort this out is to use the IIS Express tray icon to stop the web site that is causing the problem. To do this, click the little upward-pointing arrow in the right-hand end of the task bar and right-click the IIS Express icon. This will pop up a small window showing you the web sites that IIS Express is currently running...

IIS Express pop up

If you click on one of the items under "View Sites" you have the option to stop that site. Or, you can click the Exit item at the bottom of the window to stop all web sites.

That should enable you to debug in Visual Studio. When you start debugging again, IIS Express will automatically restart the web site, and should be able to allocate the port.

If that fails, you have to do it the dirty way. Open Windows Task Manager and kill the Microsoft.VisualStudio.Web.Host.exe*32 process, then you can run the project fine. Note that this will kill IIS Express completely, meaning that all web sites will stop, so you'll have to restart each one in VS if you want to debug any others. Try the pop-up icon method first tough as it's cleaner and safer.

Don't know if this answers your issue, but it works for me.

Update Thanks to JasonCoder (see comment below) for adding that on Win10, the process is Microsoft.VsHub.Server.HttpHost.exe

查看更多
家丑人穷心不美
6楼-- · 2019-01-12 17:27

When using Visual Studio 2015 the solution can be a bit different to the previous answers. VS2015 creates a hidden folder .vs under the same folder as your solution file. Under this is a config folder containing applicationhost.config. Deleting this file (or the entire .vs folder) then starting VS2015 to recreate it can fix this error.

查看更多
ゆ 、 Hurt°
7楼-- · 2019-01-12 17:27

I ran into this same error message, but it looks like it was produced from IIS Express. This article helped me resolve it

TL;DR

Run the following command from an Administrative command prompt:

> netsh http add iplisten ipaddress=::
查看更多
登录 后发表回答