I am using VS2015 and I am trying to run a website application, but every time I run the project I can't load the IISExpress because it says that the port 80 is in use, I run the Tcpview.exe from SysInternals to see who was using the port, but seems not to be in use. I found some related threads saying that can be a problem with the antivirus, I am using Symantec.
Here are the properties of the project, as you can see I tried to change the port manually, but it didn't worked
See the picture below
It is something weird, if the website is inside a solution, seems that it doesn't load correctly the application and all the time the port is ins use. I solved it using this approach
https://stackoverflow.com/a/34309702/7019416
I just loaded directly using the Visual Studio Option-> Open-> Website and removing the entries from that the post below advice
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. (Actually user=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?
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.
I solved the error by changing the port for the project.
I did the following steps:
1 - Right click on the project.
2 - Go to properties.
3 - Go to Server tab.
4 - On tab section, change the project URL for other port, like 8080 or 3000.
Good luck!
Yeah, I agree, top answers are really pro solutions. Here is one for intermediates:
Solution Explorer
Right click on project select Unload project
Again Right click and select Edit ProjectName.csproj
Remove these 3 lines
<DevelopmentServerPort>0</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:62940/</IISUrl>
Save and reload the project, and you are good to go.
try (as elevated administrator)
netsh http delete urlacl url=http://*:62940/
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.
Got this error as well lately. Tried all the above fixes, but none worked.
To disable it, type services.msc in command prompt, then right click and disable Internet Connection Sharing. I edited the properties of it as well to disable at startup. Mine looks like so now: services capture screenshot.
I got the same issue when running my application from Visual Studio 2019 on Windows 10.
After some time googling and trying various proposed solutions without success, I determined that the "Access Denied" error was a result of the port number my application uses (50403) falling in an "excluded port range".
You can view the excluded port ranges with the following command:
netsh interface ipv4 show excludedportrange protocol=tcp
After some more time googling I found that the two most likely culprits that create these exclusion ranges are Docker and Hyper-V. Docker was not installed on my computer but Hyper-V was.
My Solution
Disable Hyper-V: Control Panel-> Programs and Features-> Turn Windows features on or off. Untick Hyper-V
Restart the computer.
Add the port you are using to the port exclusion range: netsh int ipv4 add excludedportrange protocol=tcp startport=50403 numberofports=1 store=persistent
Reenable Hyper-V
Restart the computer
I added the port I am using to the exclusion list to ensure that I won't get this problem again after reenabling Hyper-V. After Step 4 and 5 when I viewed the excluded port range I can see that Hyper-V reserved a port range starting with the next port after my port.
My application now worked perfectly!
This is the only solution I found
net stop winnat
net start winnat
Thanks to Matt
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.
I just had a similar issue. I'm not totally sure how to describe the actual fault but it seems like the hostname in the reservation is incorrect. Try this in an elevated command prompt...
netsh http delete urlacl url=http://localhost:62940/
... then ...
netsh http add urlacl url=http://*:62940/ user=everyone
and restart your site. It should work.
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=::
After trying a number of suggested solutions without success I just rebooted my PC. After that the problem didn't occur anymore.
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.
If you're having this after installing Visual Studio 2015 and you can see Error messages in System event log such as this: Unable to bind to the underlying transport for [::]:{your_port}. . The IP Listen-Only list may contain a reference ... then you might be missing a registry entry.
Run this under administrative command prompt: netsh http add iplisten ipaddress=:: to fix it.
I found the solution described in detail here
After all of the steps listed here failed for me I got it working by running VS2015 as administrator.
This happened to me on Windows 10 and VS 2013.
Apparently there is a maximum port number IIS Express handles.
Ports above 62546 don't work for me.
The error can be solved if you just restart Visual Studio. It has the same effect as restarting the Microsoft.VisualStudio.Web.Host.exe*32 process.
Got the same issue where IIS express complained about http://localhost:50418/ and none of above solutions worked for me..
Went to projektFolder --> .vs --> config --> applicationhost.xml
In the tag <sites> I found that my web app had two bindnings registered.
<site name="myApp.Web" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\git\myApp\myApp.Web" />
</application>
<bindings>
<binding protocol="https" bindingInformation="*:44332:localhost" />
<binding protocol="http" bindingInformation="*:50418:localhost" />
</bindings>
</site>
Removing the binding pointing to *:50418:localhost solved the issue.
Using VS2017 and IISExpress v10.
My issue turned out to be that I had SSL Enabled on the project settings. I simply disabled this because I did not require SSL for running the project locally.
In Visual Studio 2015:
Select the project in the Solution Explorer.
In the Properties window set SSL Enabled to False.
I was able to run the project.
In my situation I was getting an error about port 443 in use because this was the port set on the SSL URL for the project.
Running netstat -abn I noticed that the software "Duet Display" was reserving thousands of ports in the ~51000 range.
Closing it solved my problem.
Sometimes this error my be another Visual Studio version running on the same machine.
Go to the project "Properties" => "Web", and on the "Servers" section change the port to something else that is not used in and save it. You will be asked to created a virtual directory and click "Yes". Now run the project and it will work now.
In my case it worked at first and after a while stopped working and IIS Express reported that the port was in use.
netstat -ab showed that Chrome was using the port. After I quit Chrome, it started working again.
I am not sure however, why Chrome would occupy that port.
This happened to me on Windows 7 and VS 2013 while viewing a project on the browser after build. I only had to close the browser "Chrome" then made sure that the port is not in use in my Network Activities using some utility (Kaspersky) then tried again and worked without any problems.
In Visual Studio 2015:
Find your startup page in your project (eg: mypage.aspx) , and right
click on it.
Click on Set as Start Page.
Right click on the project.
Click on Properties.
Click on the Web Tab on the left.
In Project URL, enter a different port, such as: http://localhost:1234/
In Start Action, select Specific Page: mypage.aspx or select Specific URL: http://localhost:1234/mypage.aspx?myparam=xxx
I write it for information.
Delete the file in the project.
After Clean>Build>Proje Start
I solved this issue by killing all instances of iexplorer and iexplorer*32. It looks like Internet Explorer was still in memory holding the port open even though the application window was closed.
I had this issue with JetBrains Rider, specifically for port 80 and 90 bit it was working with other ports as well as visual studio.
after running as admin this resolved the issue.
In Visual Studio 2019
Just remove Debug profile and create new one Do the Trick
Go to Project properties In debug tab
try first Changing ports Web Server Settings
if Changing ports not worked then Remove Debug Profile and Create new One-Warning Make Sure You Know Previous Settings
What worked for me is disabling all other network adapters, except the one I'm currently using. The event in event viewer was:
Unable to bind to the underlying transport for [::]:50064. The IP Listen-Only list may contain a reference to an interface which may not exist on this machine. The data field contains the error number.
Since I have VMware Workstation, Docker (and thus Hyper V) some VPN clients, I have a lot of network interfaces.
When you run an application from within visual studio, it seems to pick a random port on localhost. For example, running an application right now, I get
http://localhost:3240/ApplicationStuffHere
I realize this port gets loaded into the solution file, via
VWDPort = "3240"
How does this get decided on? it seems fairly random.
By default, ASP.NET Web Application Projects are configured to launch and run using the built-in VS Web Server (aka Cassini) on a random HTTP port on the machine.
This port number can be changed if this port is already in use, or if you want to specifically test and run using a different number:
(source: scottgu.com)
I know this is a little bit old, but I was wondering the same thing. I eventually found the answer for VS2005, but figured I'd share it with the stack overflow community.
Open your project
Click (not right click) on the name of the project in the solution explorer (that top, bolded line)
Hit f4 - this will bring up a properties panel
Change "Use dynamic ports" to False
Optionally change the Port number to whatever port you want to use
And you're done.
This port number is initially assigned randomly, but Visual Studio will try to use that same port number every time the application starts.
Check out the Properties of your web application in solution explorer (Right click > Properties)
The web tab is the one you are looking for.
Kindness,
Dan
Are there any particular settings one should optimally enable/disable/tweak when doing ASP.Net MVC development on local test machine Windows 7 using IIS 7.5 and moving in and out the debugger & recompiling refrequnetly (integration/troubleshooting stage now before TDD fantactics throw stones - although admittedly I could have more under test), I work with 64 bit edition but figure this probably applicable at both x86/x64?
I'll start with one:
Ping Period (seconds) - increase from 90 to 3000 (or something somewhat higher) so you can if unfortunately need to a good bit of time whilst debugging or disable ping on local test machine.
Credit: http://blogs.msdn.com/johan/archive/2007/09/12/my-web-application-times-out-when-debugging-in-iis7.aspx
However I see over stuff such as:
Disable Overlapped Recycle & Recycling settings etc.. that I wonder if could increase performance or make debugging less friction
Question prompted by the annoyance that I've ran across a few recent debugging issues (not apparent in production) including a random, and tempormental error "An assembly with the same simple name blah-blah-lah-assembly-definiton has already been imported . Try removing one of the references or sign them to enable side-by-side." (iisreset resovles) and generally slow debugging attaching. The points and answers to this question need not help with the above (I believe it may be related to spark view engine as that where the stacktrace ends) but figure it worth mentioning incase someone has a direct suggestion *
quick tip: if you're experiencing slow response times (~1-1.5 sec) from browsers other than internet explorer (eg: firefox, chrome, safari) while running your mvc/ other web app on your local machine using win7/vista, it is due to dns resolution with ipv6.
firefox solution: disable ipv6 in about:config (boolean cfg 'network.dns.disableIPv6')
machine wide soft solution: uncomment the good old localhost address in the hosts file (%WINDIR%\System32\drivers\etc\hosts):
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
# ::1 localhost
machine wide hard solution: disable ipv6 completely
credit goes to this blogpost: http://weblogs.asp.net/dwahlin/archive/2007/06/17/fixing-firefox-slowness-with-localhost-on-vista.aspx
Embarcadero guys just published a fresh article on similar topic for Delphi Prism (aka Delphi for .NET), so why not take a look on their suggestions?
http://edn.embarcadero.com/article/40108
From the experience i have working with asp.net mvc, i can tell that there are no special settings for IIS 7 or IIS 7.5 for working on asp.net mvc projects. It works fine in the default form, you just need to create a new website and point it to the folder that has the files for you application.
For debugger if you ask, you can simply put a breakpoint in the code and hit that breakpoint when you run the application from visual studio. But by default the application will use the development web server that fires up when you run a web application from visual studio. If you want to the application to run using the IIS installed on your system you will have to change the project settings. See here for a screen shot of how to do so
http://blogs.bootcampedu.com/blog/post/Debugging-aspnet-mvc-application-using-IIS.aspx
Additionally you can also use System.Diagnostics.Debugger.Break(); for putting a break point in the code.
If you only want to debug your application, I recommend to use the built-in development server of Visual Studio.
If you debugged the most of it or want to do that on IIS, I recommend you the Ctrl+Alt+P shortcut, which enables you to attach a debugger. Select w3wp.exe and you can debug with IIS.
When I yesterday returned to Visual Web Developer I was no longer able to run/debug my projects. Clicking the green play button launches ASP.NET Development Server (and it shows up in the systray) but the browser only shows the error message "Firefox is not able to connect to localhost:58127" (translated from Swedish). IE7 says "Cannot show web page".
I cannot figure out why this happens. It worked a couple of weeks back. Could there be a Windows setting that mess things up? (I've tried to disable the firewall without any change.)
Are you using Vista? I've had the same issues with recent Vista updates.
Firstly, make sure Visual Studio is running "As Administrator".
Secondly, when the browser launches, replace "http://localhost:" with "http://127.0.0.1:". If that works, then its because a Windows Update messed up your hosts file.
If this is the case, make sure you hosts file has this line in it, uncommented: "127.0.0.1 localhost"
my hosts file is in this directory: "C:\Windows\System32\drivers\etc"
yours will be something similar to that.
Are you perhaps using NOD32 or any other antivirus that may cause problems?
I encountered this issue today and just wanted to elaborate because my hosts file had "127.0.0.1 localhost" already defined.
I was able to see the default IIS site by referencing localhost but when I tried debugging in my IDE it would always display "cannot display webpage" in IE and "Oops! Google Chrome cannot connect to localhost" in Chrome.
I opened a command prompt and typed "netstat -a" and reviewed the results. I saw that my port used by my debugging web server was listed as "LISTENING" on the local address of [::1] only:
TCP [::1]:64212 [ComputerName]:0 LISTENING
What's unusual to me is that debugging worked for a period of time and then it seemed like all of a sudden it stopped. The first couple times it happened I re-installed Visual Web Developer Express 2010. This became rather annoying because it was a long process and the problem continued to resurface after what seemed to be an arbitrary period of time.
This latest time I changed my hosts file to include "::1 localhost" (the opposite of this solution and numerous others I found online) and that has resolved my issues with my debugging environment.
I'm grateful this resolved my issue but am still curious as to why and how my debugging environment seems to change. Additionally, I'm curious why there are multiple loopback addresses other than 127.0.0.1. Is "::1" an ip6 standard? If so, shouldn't localhost be routing to 127.0.0.1 and interpreted by the tcp/ip stack as the same as ::1?
I had this problem with Visual Studio 2013. I have set the Firewall system manually. This means that, at the time of communication by programs Firewall notify me. Incorrectly linked to "devenv.exe" was blocked by the Firewall. Correct mode of communication "devenv.exe" will solve the problem. in your case cheeck Firewall options and filtered communications.