231

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?

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?

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

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

4
  • 2
    Run netstat -aon | findstr to see if another application also monitors port 62940. If so, you cannot monitor that port but have to switch to another port. Don't change applicationHost.config or netsh http when they are obviously not the cause.
    – Lex Li
    May 7, 2014 at 9:21
  • I ran netstat as suggested. No application seems to be monitoring port 62940. Something else must be wrong.
    – Linus
    May 9, 2014 at 10:48
  • 3
    Rebooting worked for me. Oct 7, 2015 at 13:35
  • Restarting VS solved the issue for me.
    – gajama
    Apr 1, 2022 at 13:00

43 Answers 43

1
2
1

Looks like everybody has own problem Just sharing what I did to fix this problem in VS2015 (Windows 8.1), my solution has 6 web sites (not web apps)

  1. Open your solution file *.sln
  2. Change in your solution file string VWDPort = "34781" (make it unique in your solution if you have more that 1 web site, I made +2) in notepad.

See sample solution file ProjectSection(WebsiteProperties):

Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "BOSTONBEANCOFFEE.COM", "Source_WebOfficeV4\BOSTONBEANCOFFEE.COM", "{5106A8F5-401B-4907-981C-F37784DC4E9D}"
ProjectSection(WebsiteProperties) = preProject
    SccProjectName = ""$/PrismRMSystem/VS2012/WebOfficeV4.root/WebOfficeV4", IPYHAAAA"
    SccAuxPath = ""
    SccLocalPath = "..\.."
    SccProvider = "MSSCCI:Microsoft Visual SourceSafe"
    TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0"
    ProjectReferences = "{04e527c3-bac6-4082-9d39-aad8771b368e}|YBTools.dll;{5d52eaec-42fb-4313-83b8-69e2f55ebf14}|AuthorizeNet.dll;{d8408f53-8f1e-4a71-8b05-76023b09b716}|AuthorizeNet.Helpers.dll;{77ebd08a-de0f-4793-b436-fad6980863e6}|WEBCUSTCONTROLS.dll;"
    Debug.AspNetCompiler.VirtualPath = "/BOSTONBEANCOFFEE.COM"
    Debug.AspNetCompiler.PhysicalPath = "Source_WebOfficeV4\BOSTONBEANCOFFEE.COM\"
    Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\BOSTONBEANCOFFEE.COM\"
    Debug.AspNetCompiler.Updateable = "true"
    Debug.AspNetCompiler.ForceOverwrite = "true"
    Debug.AspNetCompiler.KeyFile = "Key\StrongKey.snk"
    Debug.AspNetCompiler.DelaySign = "false"
    Debug.AspNetCompiler.AllowPartiallyTrustedCallers = "false"
    Debug.AspNetCompiler.FixedNames = "true"
    Debug.AspNetCompiler.Debug = "True"
    Release.AspNetCompiler.VirtualPath = "/BOSTONBEANCOFFEE.COM"
    Release.AspNetCompiler.PhysicalPath = "Source_WebOfficeV4\BOSTONBEANCOFFEE.COM\"
    Release.AspNetCompiler.TargetPath = "PrecompiledWeb\BOSTONBEANCOFFEE.COM\"
    Release.AspNetCompiler.Updateable = "true"
    Release.AspNetCompiler.ForceOverwrite = "true"
    Release.AspNetCompiler.KeyFile = "Key\StrongKey.snk"
    Release.AspNetCompiler.DelaySign = "false"
    Release.AspNetCompiler.AllowPartiallyTrustedCallers = "false"
    Release.AspNetCompiler.FixedNames = "true"
    Release.AspNetCompiler.Debug = "False"      
    VWDPort = "34781"
    SlnRelativePath = "Source_WebOfficeV4\BOSTONBEANCOFFEE.COM\"
EndProjectSection

In my case, I tried to change URL from project properties, restart VS, reboot computer, nothing helped me only this SLN file manipulation fixed my problem.

1

For me this problem was entirely related to a broken install of Oracle ODP tools for VS. I uninstalled and reinstalled and everything was working again.

1

I write it for information.

Delete the file in the project.

After Clean>Build>Proje Start

1

And in my case, it turned out that I didn't have IIS enabled in Control Panel under Windows Features. Reference Image, since SO won't let me upload

1

In VS2017. I had to edit my .sln file and had to update the VWDPort = "5010" setting. None of the other solutions posted here worked.

1

In my case, I had the setting Override application root URL checked, on the Properties->Web tab. I was using that previously when I was running VS as an administrator, but now that I'm running it in a non-admin account, it causes the error.

1

None of the above worked for me but the solution here https://forums.asp.net/t/1979442.aspx?Cannot+change+the+project+URL+in+project+properties did.

Once I had the solution file open in notepad I did a find and replace of the port that was causing the problem, saved it and reopened the solution in visual studio. The first time I picked a port number that was only 1 off from the one that was causing my problem and I still got the same error. When I changed to a port that something like 10,000 off it worked. I'm not sure if that makes a difference.

1
1

I also read the answers and comments and tried some solutions from this thread.

Then a Googled a little more and this worked for me

https://www.c-sharpcorner.com/blogs/iis-express-failed-to-register-url-access-is-denied

Didn't comment on no one's answer because I didn't read whats written here, so it needed a new answer post. There's answers here that talk about netsh wlan stuff, but I didn't see exactly this solution. If some one wrote the exact same solution please tell me so I can comment there and remove this.

1

I have the same with VS2019 occasionally.

The general problem is that the port is already taken or not usable, and there's a lot of possible reasons for that, resulting in lots of different answers here.

I want to add what helped me: The problem was just temporary and I tried again without changing anything and it just worked. So I just propose to test this first, because it is the easiest thing to do.

1

This is for Visual Studio 2019, After trying a lot of suggestions that failed to work (including changing the port number etc) I solved my problem by deleting a file that was generated on my project's root folder called "debug". As soon as this file was deleted everything started working.

1

Folks, i read all the comments ranging between 2 page views and still none helped my situation. Although, some helped to a little extent. Finally this is what helped solved my situation and i assume it may be the case for someone else too.

I have a docker Desktop as well in my laptop and I was running some in Docker. Then, i opened my VS and wanted to debug my specific app. Although with VS 2019 and the web api is configured to use Https port, the http port was causing this issue. After attempting all the steps that were mentioned in the answers, i went with my gut

  1. to stop and kill my docker desktop app.
  2. Then stopped the running IIS Express.
  3. Just simply pressed F5 (to debug) and voila!

So, there are various reasons to this issue and it depends on individual's machine status and apps they have.

I tried deleting the .vs folder, removing the IISExpress folder in user profile's documents folder, but then, my Docker app I guess must be taking over the remaining IP addresses if my VS is not using them.

So, kindly check any other apps that may take/consume some span or range of IPs and try kill them. In my case, I started Docker again after running my VS and things are going as expected so far!

1

I tried all the answers above. It only worked when I stopped the Windows Service ICS (Internet Connection Sharing).

1
  • This approach really helped me out. For those looking to apply this solution using PowerShell (run as admin), here's the script I ended up using: First, get the ProcessId: Get-WmiObject -Class Win32_Service -Filter "Name LIKE 'SharedAccess'" | Select-Object -ExpandProperty ProcessId Then, use the ProcessId you obtained in the following command (replace [pidid] with the actual ProcessId): taskkill /pid [pidid] /f Mar 13 at 9:10
0

First of all, running VS as an Administrator solved the problem. But the weirdest part I already checked the "run as administrator" setting on the shortcut which seemed not working.

Looks like we need to explicitly click "run as administrator" choice from the shortcuts context menu

enter image description here

enter image description here

1
2

Not the answer you're looking for? Browse other questions tagged or ask your own question.