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:
Deleted
%userprofile%\Documents\IISExpress\
, tried to run.netsh http add urlacl url=http://localhost:62940/ user=everyone
, rebooted and tried to run. (Actuallyuser=Alla
since Swedish Windows).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/" ...
.Reinstalled IIS 8.0 Express
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.
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.
This happened with me when I was trying to access my site from a remote location:
At first, applicationhost.config (VS2015) contained the standard:
In order to access my site from a remote location within the network, I added (step 1):
Then, I entered into CMD with Admin rights (step 2):
As step 3, I added it a rule to the firewall.
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:Now, it works again.
I write it for information.
Delete the file in the project.
After Clean>Build>Proje Start
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...
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
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.
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: