unable to launch iis express web server port 80 is in use - iis

I have MVC4 web application project in visual studio 2010. When I want to start it, I have the following error:
Unable to launch the IIS Express Web server: Port"80" is in use.
The problem came after changing the property "Use Local IIS Webserver"

http://blog.lextudio.com/2012/10/port-already-in-use-then-who-uses-it/
If you already have something monitoring port 80 (such as full IIS), then you cannot use another thing to monitor the same port.
Thus, if you do want to use IIS Express, make sure in Project Url: field you specify another port number other than 80.

In VS 2013:
Go to your Web Project Properties, Web Tab.
Select "IIS Express" from the dropdown.
Enter a project URL, such as http://localhost:64510/
If you have "Override application root URL" checked, uncheck it.

The port is probably in use. I usually end the iisexpress.exe. This works if for some reason the port is open and you want to close it.
CTRL+ALT+DEL -> Task Manager ->End process for iisexpress.exe

I just had this happen to me, and didn't understand why as everything had worked fine until restarting my machine. Seems that the full IIS service was running, but only within the manager had it been STOPPED, so when I restarted it turned back on.
FIX IT THIS WAY:
Open up the Internet Information Services (IIS) Manager (use search programs and files, too. See image)
Right click on localhost (top level, left pane), select STOP. Not called 'localhost'? This will probably be called your machine name, but if you hover over the top level on the left pane, you should see 'https://localhost/'. This is what you want. Right click and select STOP.
Now, this is assuming you only want to run IIS Express sites, as anything that required the full IIS won't be running. You should be good to go!

If IIS is running and you are using IIS Express you should stop IIS for it to work.

Such error can appear when YourApp.csproj file contains conflicted settings.
<!-- conflicted settings -->
<UseIISExpress>true</UseIISExpress>
...
<IISUrl>http://localhost/application/</IISUrl>
If you want to use IIS Express you should change IISUrl to http://localhost:11222/ or another free port.
<!-- settings for IIS Express -->
<UseIISExpress>true</UseIISExpress>
...
<IISUrl>http://localhost:11222/</IISUrl>
If you want to use IIS you should set UseIISExpress to false.
<!-- settings for IIS -->
<UseIISExpress>false</UseIISExpress>
...
<IISUrl>http://localhost/application/</IISUrl>

Another answer does mention this, however, if you're using IIS Express within Visual Studio AND have IIS enabled in Windows Features; It will be the "Default IIS Site" that is using port 80. Simple open IIS and stop the site running by right-clicking on the top node.

Sql Server could also be the culprit. I stopped Sql Server and it freed up the port.

Related

Stop IIS while using Xampp (Windows 10 - conflicts of ports)?

In Windows 10 IIS and Xampp use the same port (80), I've learned. I know how to change port in Xampp, but I'd prefere to stop IIS while using Xampp. On my old computer with Windows 10 I went to task manager > services and stopped World Wide Web Services by rightclicking. On my new computer with Windows 10, I can't seem to find World wide web services on that spot. Can it be named something else, according to language (swedish - though before on the old computer it was named as mentioned)? Any other way (in simple steps, please - beginner!) to stop IIS using the port, without disabling the IIS alltogether? (might want to learn how to use it later on)
Thanks in advance!
Port 80 is used by default with many web servers (here IIS and Apache which is bundled inside XAMPP).
The default web site created with IIS uses port 80. If you don't want to use this default web site (absolutely no harm and no data loss!), you can delete it by running the following command in inetsrv directory (path would generally be C:\Windows\System32\inetsrv).
appcmd delete site "Default Web Site"
Or you can change the port for the default web site in IIS, with:
appcmd set site /site.name: "Default Web Site" /+bindings.protocol='http',bindingInformation='*:8000:']
appcmd set site /site.name: "Default Web Site" /-bindings.protocol='http',bindingInformation='*:80:']
(8000) is for instance, use any high number you like.

How can I change the Start Automatically setting in IIS 8.5

I have a problem with a web site running on an IIS 8.5 server that is not started automatically when the server reboots. The site is originally installed through ServerManager, where there is this line of code:
site.ServerAutoStart = false;
Now I would like to change this setting through the IIS Manager interface.
In IIS 7.5 i can set a web site to start automatically by setting the Start Automatically property under Advanced settings. But this setting is gone in IIS 8.5.
I found a solution to my problem inspired by this question:
How to config application pool in IIS 7.5 automatically re-start when it was stopped?
It is possible to access and edit all the detailed settings through the Configuration Editor, which can be accessed through the Features View in IIS Manager. I realize that in the link Mr Mo sent, the Configuration Editor was used, but it is not specified very clearly how to access it.
Check it out:
http://blogs.msdn.com/b/benjaminperkins/archive/2014/01/07/configure-the-iis-application-initialization-module.aspx
I think it will solve the issue.

IIS and Visual Studio is having different result

http://localhost:72/Home/Support?_subject=&_category=&_reportedDateFrom=09%2F05%2F2013&_reportedDateTo=09%2F05%2F2013&_solvedDateFrom=&_solvedDateTo=&_status=
Above is the pre-setup IIS website .. the date filtering is not filtering correctly.
http://localhost:54550/Home/Support?_subject=&_category=&_reportedDateFrom=09%2F05%2F2013&_reportedDateTo=09%2F05%2F2013&_solvedDateFrom=&_solvedDateTo=&_status=
Above is the visual studio debug URL, just the port number is different and it's working perfectly.
I have no idea what is happening.
To debug this I would start with the following:
Do a clean and rebuild of your solution.
Make sure you don't have two copies of the application running.
Make sure the application is being hosted in IIS properly. (Does the app show up when you right click and browse the web site from the IIS manager)
Attach the debugger to the process running under IIS in order to inspect the query parameters.
This article is getting a bit old but it has the general procedure you need to follow to attach to IIS to inspect a process.

IIS 7.5 broken, cannot connect to localhost, error 404

Someone set up IIS 7.5 on my computer with a sample project. I created a new project and I wanted this new project to be accessible on the localhost (default port 80). I changed the Site (under Sites in the navigator) in the IIS Manager and now I can't do anything.
When I try to run the project from Visual Studio it opens successfully in the browser in "localhost/#somePort" but when I try to type in just "localhost" into the browser, I get a 404 Error.
Please, any ideas on how to fix this? I think maybe some default files for IIS were changed/corrupted.
Usually from Visual studio if it's an ASP.net project it will run from the Web Developer test engine (which is a mini iis that runs on a random port)... You need to publish the project to IIS or copy the compiled output to a folder that is within your IIS's site's directory path and change that folder to an application (from the iis mmc console, right clicking on the folder and selecting Change to Application, I believe...
I wasn't sure about the "localhost/#somePort" but i'm assuming I am getting what you meant ;)
I just ran into the same problem. Apparently changing the bindings changes only the default site / and not the child virtual applications.
I found this article - http://www.carryoverbit.com/running-iis-on-localhost-only/
Incase the link is broken...
After editing the bindings in IISManager ("Edit Bindings..."), you need to use netsh and add 127.0.0.1 as a listener for http traffic.
Open command prompt (as admin)
netsh
netsh> http
netsh http> show iplisten
(empty list is shown)
netsh http> add iplisten 127.0.0.1
IP address successfully added
Now use iisreset and everything should work.

Recreate the default website in IIS

I've accidentally deleted the default website in IIS; It no longer shows up in the tree of IIS manager and browsing "localhost" returns a 404 error.
I've re-installed IIS, but the default website still doesn't exist... Is it possible to recreate the default website so I can create my folder inside?
Other answers are basically right, thanks to them I was able to restore my default web site, they're just missing some more or less important details.
This was the complete process to restore the Default Web Site in my case (IIS 7 on Windows 7 64bit):
open IIS Manager
right click Sites node under your machine in the Connections tree on the left side and click Add Website
enter "Default Web Site" as a Site name
set Application pool back to DefaultAppPool!
set Physical path to %SystemDrive%\inetpub\wwwroot
leave Binding and everything else as is
Possible issues:
If the newly created web site cannot be started with the following message:
Internet Information Services (IIS) Manager - The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)
...it's possible that port 80 is already assigned to another application (Skype in my case :). You can change the binding port to e.g. 8080 by right clicking Default Web Site and selecting Edit Bindings... and Edit.... See Error 0x80070020 when you try to start a Web site in IIS 7.0 for details. Or you can just close the application sitting on the port 80, of course.
Some applications require Default Web Site to have the ID 1. In my case, it got ID 1 after recreation automatically. If it's not your case, see Re-create “default Website” in IIS after accidentally deleting. It's different for IIS 6 and 7.
Note: I had to recreate the Default Web Site, because I wasn't able to even open a project configured to run under IIS in Visual Studio. I had a solution with a couple of projects inside. One of the projects failed to load with the following error message:
The Web Application Project is configured to use IIS. The Web server 'http://localhost:8080/' could not be found.
After I have recreated the Default Web Site in IIS Manager, I was able to reload and open that specific project.
Did the same thing. Wasn't able to recreate Default Web Site directly - it kept complaining that the file already existed...
I fixed as follows:
Create a new web site called something else, eg. "Default", pointing to "C:\inetpub\wwwroot"
It should be created with ID 1 (at least mine was)
Rename the web site to "Default Web Site"
I suppose you want to publish and access your applications/websites from LAN; probably as virtual directories under the default website.The steps could vary depending on your IIS version, but basically it comes down to these steps:
Restore your "Default Website" Website :
create a new website
set "Default Website" as its name
In the Binding section (bottom panel), enter your local IP address in the "IP Address" edit.
Keep the "Host" edit empty
that's it: now whenever you type your local ip address in your browser, you will get the website you just added.
Now if you want to access any of your other webapplications/websites from LAN, just add a virtual application under your default website pointing to the directory containing your published application/website. Now you can type : http://yourLocalIPAddress/theNameOfYourApplication to access it from your LAN.
You can try to restore your previous state by doing the following:
Go to IIS Manager
Right-click on your Local Computer.
Point to All Tasks
Point to Backup/Restore Configuration
Select the configuration you want to restore
Wait untill configuration applies
Check out this answer on SuperUser:
In short: Reinstall both IIS and WAS.
In details -
Step 1
Go to "Add remove programs"
"Turn windows features on or off"
Remove both IIS and WAS (Windows Process Activation Service)
Restart the PC
Step 2
Go to "Add remove programs"
"Turn windows features on or off"
Turn on both IIS and WAS (Windows Process Activation Service)
Note: Reinstalling IIS alone won't help. You have to reinstall both IIS and WAS
This approach fixed the problem for me.
Follow these Steps
Restore your "Default Website" Website :
create a new website
set "Default Website" as its name
In the Binding section (bottom panel), enter your local IP address in the "IP Address" edit.
Keep the "Host" edit empty
I deleted the C:\inetpub folder and reinstalled IIS which recreated the default website and settings.

Resources