How to Change Iis Express Port for a Site

How can I change IIS Express port for a site

To specify a port for a Web application project that uses IIS Express

  1. In Solution Explorer, right-click the name of the application and then select Properties.
    Click the Web tab.

  2. In the Servers section, under Use Local IIS Web server, in the Project URL box change the port number.

  3. To the right of the Project URL box, click Create Virtual Directory, and then click OK.

  4. In the File menu, click Save Selected Items.

  5. To verify the change, press CTRL+F5 to run the project.
    The new port number appears in the address bar of the browser.

From How to: Specify a Port for the Development Server (archive.org backup here).

ASP.NET Core: How to change IIS Express port?

I found the solution. When changing the SSL port number, it must be within 44300 - 44399 otherwise it won't work. Reference: developercommunity.visualstudio.com/comments/43139/view.html. @Tseng, please remove the "duplicate" flag

Visual Studio 2015 / IISExpress change SSL port

I had the same situation with 2 projects. Visual Studio 2015 correctly assigned differing URL port numbers for HTTP but mapped both projects to 44300 for HTTPS.

AFAIK the applicationhost.config in .vs\config seems to define the IIS Express environment and tell IIS Express how to behave when invoked. This information doesn't feedback into Visual Studio.

Visual Studio appears to rely on settings in the .csproj file. This is the SSL port value you see when you look at properties for the project in VS.

I was able untangle the two projects by adjusting both:

  1. Changing the IISExpressSSLPort value in my project's .csproj file
  2. I also needed to ensure that the https binding was included in the applicationhost.config

.csproj

<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort>44301</IISExpressSSLPort>

applicationhost.config

<bindings>
<binding protocol="http" bindingInformation="*:58001:localhost" />
<binding protocol="https" bindingInformation="*:44301:localhost" />
</bindings>

Update:

The file .csproj.user also has SSL Port configuration, to avoid the overwriting of the SSL port number in the applicationhost.config file, .csproj.user should be updated too.

<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort>44301</IISExpressSSLPort>

Where do I specify my SSL port for IISExpress?

Open launchSettings.json under the ./Properties folder. The int value in iisSettings > iisExpress > sslPort is where it's read from. You can change that value to whatever you want.

{
"iisSettings": {
"iisExpress": {
"sslPort": <ssl-port-value>
}
}
}

IIS Express Web Server Port Is In Use

The link that Krishna provided inspired me to open IIS and discover that there was a local web site in IIS with the same port (it was the same web service). I deleted that, and now I can debug my application again.

I cannot explain why I couldn't see the port in use, why it started offering the web page when the project was loaded in Visual Studio, and why I couldn't see that IIS was running in the task manager. I am guessing that Visual Studio was actually running it somehow.

Thanks to all respondents for their help!



Related Topics



Leave a reply



Submit