How can I change IIS Express port for a site
To specify a port for a Web application project that uses IIS Express
In Solution Explorer, right-click the name of the application and then select Properties.
Click the Web tab.In the Servers section, under Use Local IIS Web server, in the Project URL box change the port number.
To the right of the Project URL box, click Create Virtual Directory, and then click OK.
In the File menu, click Save Selected Items.
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:
- Changing the IISExpressSSLPort value in my project's .csproj file
- 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
Viewmodel Validation for a List
Why Does .Net Foreach Loop Throw Nullrefexception When Collection Is Null
(.1F+.2F==.3F) != (.1F+.2F).Equals(.3F) Why
Xmlserializer - There Was an Error Reflecting Type
Creating a Proxy to Another Web API with ASP.NET Core
Why Use Asqueryable() Instead of List()
Datetimepicker: Pick Both Date and Time
Pair Bluetooth Devices to a Computer with 32Feet .Net Bluetooth Library
Put Content in Httpresponsemessage Object
Display Hourglass When Application Is Busy
How to Create a Friendly Url in ASP.NET MVC
How to Ignore a Property When Serializing Using the Datacontractserializer
Cannot Find .Cs Files for Debugging .Net Source Code
How to Clear Tracked Entities in Entity Framework
How to Create Migrations After Upgrading to ASP.NET Core 2.0