OK, so I used to be able to change the SSL port number in the project properties dialog, but after the asp.net 5 RC1 update, the SSL field is read-only:
It ignores the SSLPort value when I attempt to edit the .xproj directly:
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
<DevelopmentServerPort>17204</DevelopmentServerPort>
<SSLPort>44303</SSLPort>
</PropertyGroup>
And it also resets the port in my app host config file ($[solutionDir].vs\config\applicationhost.config) back to the original value when I change the binding and launch my project.
<site name="WebApplication1" id="8">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\WebApplication1\wwwroot" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:17833:localhost" />
<binding protocol="https" bindingInformation="*:44303:localhost" />
</bindings>
</site>
What gives? Where is Visual Studio getting this value from, and how do I change it?
By default IIS Express uses port 8080, but you can use any HTTP port you like. You can also run these from the WIndows Command line in the Web Connection install folder by running Console.exe .
In Solution Explorer, right-click the name of the web application and select Properties. Click the Web tab. In the Servers section, under dropdown selection for IIS Express, change the port number in the Project URL box. To the right of the Project URL box, click Create Virtual Directory, and then click OK.
To enable the SSL with in IIS Express, you have to just set “SSL Enabled = true” in the project properties window. With this; you can access any of the URL from your browser and run the application. Hope this helps.
Copy that URL and go to the project properties window. Locate the Web tab and override the Project URL property with the https address: After that, you need to setup a trusted certificate for Visual Studio.
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>
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With