How do I start/stop IIS Express Server?
Asked Answered
A

7

63

I have installed MS Visual Web Developer 2010 which includes IIS Express.

Before this, I had installed XAMPP server for my php applications.

I would like to know how can I stop IIS in order to be able to start XAMPP? It appears that they use the same port. I guess those could be changed, but I do not want to interfere with other programs, and more than that I think this should be simpler.

Thanks!

Altamirano answered 31/3, 2012 at 12:4 Comment(1)
I faced the same issue, and found out that there was 'Web Deployment Agent Service' running on the port 80. Use this article to track down which process uses it, and turn it off: sites.google.com/site/anashkb/port-80-in-usePsychosis
B
100

Closing IIS Express

By default Visual Studio places the IISExpress icon in your system tray at the lower right hand side of your screen, by the clock. You can right click it and choose exit. If you don't see the icon, try clicking the small arrow to view the full list of icons in the system tray.

IIS Express icon

then right click and choose Exit:

enter image description here


Changing the Port

Another option is to change the port by modifying the project properties. You'll need to do this for each web project in your solution.

  1. Visual Studio > Solution Explorer
  2. Right click the web project and choose Properties
  3. Go to the Web tab
  4. In the 'Servers' section, change the port in the Project URL box
  5. Repeat for each web project in the solution

Changing the IIS Express port


If All Else Fails

If that doesn't work, you can try to bring up Task Manager and close the IIS Express System Tray (32 bit) process and IIS Express Worker Process (32 bit).

Terminating the IIS Express Worker Thread process

If it still doesn't work, as ni5ni6 pointed out, there is a 'Web Deployment Agent Service' running on the port 80. Use this article to track down which process uses it, and turn it off:

https://sites.google.com/site/anashkb/port-80-in-use

Badgett answered 31/3, 2012 at 12:13 Comment(6)
Thank's for the advice, but I still can't start Apache.Altamirano
Do CTRL ALT DEL and make sure all threads starting with IISexpress are terminated. Sometimes the helper threads get stuck and don't close.Badgett
Did that too, but with no success. I will just change the default 80 port for the Apache, with which I am more familiar with. Thx!Altamirano
Hello, I have changed the apache config in order to make it listen to localhost:81 instead of localhost:80. Your suggestion is logical, but it didn't work for me at that time. I just reset :80 as port for my apache, exit from incon by the clock. Still not working.. I have tried CRTL ALT DEL, but I do not see there any proccess for iis express or related. It doesn't bother me if I use :81 for apache, but in order to help others for which my workaround is not an option, tell me what should be the name of the proccess so I try to stop it. Thanks for your kindness and patience!Altamirano
Any way to do this from the command line -- so that we could use it as a prebuild step or something?Lapin
Very good documentation. Thank You, Changing the port number worked for me.Barroom
R
18

An excellent answer given by msigman. I just want to add that in windows 10 you can find IIS Express System Tray (32 bit) process under Visual Studio process:

enter image description here

Renata answered 12/7, 2018 at 20:52 Comment(0)
Z
15

Open Task Manager and Kill both of these processes. They will autostart back up. Then try debugging your project again.

enter image description here

Zipper answered 26/1, 2021 at 13:49 Comment(1)
give a medal to this guy. Thank you!Tiptop
C
2

I came across the same issue. My aim is to test PHP scripts with Oracle on Windows 7 Home and without thinking installed IIS7 express and as an afterthought considered Apache as a simpler approach. I will explore IIS express's capabilities seperately.

The challenge was after installing IIS7 express the Apache installation was playing second fiddle to IIS express and bringing up the Microsoft Homepage.

I resolved the port 80 issue by :-

  1. Stopping Microsoft WedMatrix :- net stop was /y
  2. Restarted the Apache Server
  3. Verifying Apache now was listening on the port :- netstat -anop
  4. Clearing out the Browsers caches - Firefox and IE
  5. Running localhost
Catlee answered 27/3, 2013 at 19:47 Comment(0)
S
0

Here is a static class implementing Start(), Stop(), and IsStarted() for IISExpress. It is parametrized by hard-coded static properties and passes invocation information via the command-line arguments to IISExpress. It uses the Nuget package, MissingLinq.Linq2Management, which surprisingly provides information missing from System.Diagnostics.Process, specifically, the command-line arguments that can then be used to help disambiguate possible multiple instances of IISExpress processes, since I don't preserve the process Ids. I presume there is a way to accomplish the same thing with just System.Diagnostics.Process, but life is short. Enjoy.

using System.Diagnostics;
using System.IO;
using System.Threading;
using MissingLinq.Linq2Management.Context;
using MissingLinq.Linq2Management.Model.CIMv2;

public static class IisExpress
{
  #region Parameters
  public static string SiteFolder = @"C:\temp\UE_Soln_7\Spc.Frm.Imp";
  public static uint Port = 3001;
  public static int ProcessStateChangeDelay = 10 * 1000;
  public static string IisExpressExe = @"C:\Program Files (x86)\IIS Express\iisexpress.exe";
  #endregion

  public static void Start()
  {
    Process.Start(InvocationInfo);
    Thread.Sleep(ProcessStateChangeDelay);
  }
  public static void Stop()
  {
    var p = GetWin32Process();
    if (p == null) return;

    var pp = Process.GetProcessById((int)p.ProcessId);
    if (pp == null) return;

    pp.Kill();
    Thread.Sleep(ProcessStateChangeDelay);
  }
  public static bool IsStarted()
  {
    var p = GetWin32Process();
    return p != null;
  }

  static readonly string ProcessName = Path.GetFileName(IisExpressExe);
  static string Quote(string value) { return "\"" + value.Trim() + "\""; }
  static string CmdLine =
    string.Format(
      @"/path:{0} /port:{1}",
      Quote(SiteFolder),
      Port
      );
  static readonly ProcessStartInfo InvocationInfo =
    new ProcessStartInfo()
      {
        FileName = IisExpressExe,
        Arguments = CmdLine,
        WorkingDirectory = SiteFolder,
        CreateNoWindow = false,
        UseShellExecute = true,
        WindowStyle = ProcessWindowStyle.Minimized
      };
  static Win32Process GetWin32Process()
  {
    //the linq over ManagementObjectContext implementation is simplistic so we do foreach instead
    using (var mo = new ManagementObjectContext())
      foreach (var p in mo.CIMv2.Win32Processes)
        if (p.Name == ProcessName && p.CommandLine.Contains(CmdLine))
          return p;
    return null;
  }
}
Sherronsherry answered 31/3, 2012 at 12:4 Comment(0)
S
0

You can stop any IIS Express application or you can stop all application. Right click on IIS express icon , which is located at right bottom corner of task bar. Then Select Show All Application

enter image description here

Spirketing answered 10/9, 2019 at 11:8 Comment(0)
N
-8

to stop IIS manually:

  1. go to start menu
  2. type in IIS

you get a search result for the manager (Internet Information Services (IIS) manager, on the right side of it there are restart/stop/start buttons.

If you don't want IIS to start on startup because its really annoying..:

  1. go to start menu.
  2. click control panel.
  3. click programs.
  4. turn windows features on or off
  5. wait until the list is loaded
  6. search for Internet Information Services (IIS).
  7. uncheck the box.
  8. Wait until it's done with the changes.
  9. restart computer, but then again the info box will tell you to do that anyways (you can leave this for later if you want to).

oh and IIS and xampp basically do the same thing just in a bit different way. ANd if you have Xampp for your projects then its not really all that nessecary to leave it on if you don't ever use it anyways.

Neocolonialism answered 8/3, 2013 at 12:2 Comment(3)
Unfortunately, the question was regarding IIS Express :-(Communize
The process you are explaining is about re-installing IIS and nothing to do with question.Quasimodo
These instructions are for uninstalling IIS. The question was about just stopping IIS Express.Gasworks

© 2022 - 2024 — McMap. All rights reserved.