Where do I specify my SSL port for IISExpress?

半腔热情 提交于 2020-05-26 11:22:53

问题


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?


回答1:


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>
    }
  }
}


来源:https://stackoverflow.com/questions/33790606/where-do-i-specify-my-ssl-port-for-iisexpress

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!