0

I had to use IIS v8.5 when debugging my web app in order to test a configuration option but now I want to switch back to IIS Express.

Even though I have selected IIS Express in the project properties it still tries to use IIS (http://localhost).

enter image description here

How can I force the use of IIS Express?

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
webworm
  • 10,587
  • 33
  • 120
  • 217
  • You won't be able to have two web servers both running on the same port. If you want to use IIS Express, then uninstall IIS v8.5, or change one of them to run on a different port #. – dub stylee Feb 03 '15 at 22:35
  • How do I change the port that IIS Express uses? Do I just make up a port number not in use? – webworm Feb 03 '15 at 22:36

1 Answers1

1

You should be able to change the port # of IIS Express. You can do this by entering IIS Manager, and right click on the web site you want to configure, and click "Edit Bindings". right click web site in iis

Change the port # from 80 as shown in the photo below to something like 23478 or whatever you want that isn't in use. You can find more information on the Microsoft Knowledgebase here: http://support.microsoft.com/kb/149605 edit bindings menu

Once you edit the port # that IIS Express is running on, you will have to specify it in your Visual Studio project, so the URL will be "http://localhost:23478" or whatever port instead.

EDIT:

The above description is how to change the port # of regular IIS server. In order to change the port # of IIS Express, according to https://msdn.microsoft.com/en-us/library/ms178109.ASPX follow these steps:

To specify a port for the ASP.NET Development Server

  1. In Solution Explorer, click the name of the application.

  2. In the Properties pane, click the down-arrow beside Use dynamic ports and select False from the dropdown list.

  3. This will enable editing of the Port number property.

  4. In the Properties pane, click the text box beside Port number and type in a port number.

  5. Click outside of the Properties pane. This saves the property settings.

    Each time you run a file-system Web site within Visual Web Developer, the ASP.NET Development Server will listen on the specified port.

dub stylee
  • 3,252
  • 5
  • 38
  • 59
  • 1
    I have never heard if IIS Express being managed by IIS Manager. Are you sure about this? – webworm Feb 04 '15 at 14:29
  • I suppose that the way I mentioned was backwards, and would be changing the regular IIS port #, not IIS Express. There is another answer here: http://stackoverflow.com/a/21202917/3101082 that explains how to change it for IIS Express. Basically, change the project URL to include the desired port #, then click "Create Virtual Directory". Then click OK, and to verify the changes, run your project to make sure it is using the new port #. – dub stylee Feb 04 '15 at 17:42
  • I added an edit to the original answer to explain how to change the port for IIS express. – dub stylee Feb 04 '15 at 17:47