Visual Studio 2017 Enable SSL

后端 未结 9 1221
我在风中等你
我在风中等你 2020-12-23 13:45

How do you enable SSL for a project in Visual Studio 2017?

In VS15, I could select Project -> Properties -> Debug -> Enable SSL. This option is not available in VS20

相关标签:
9条回答
  • 2020-12-23 13:57

    This is for an Asp.Net MVC .Net Framework Project

    1. Select your Project by highlighting it.
    2. Then hit F4 to open its Properties pane.
    3. Find the SSL Enabled item on list and set its value to True, and copy SSL URL value onto your clipboard.
    4. Whilst your Project is highlighted, hit Alt + Enter to open the Properties dialogue - paste the copied SSL URL into the project url under the Web menu input box.
    0 讨论(0)
  • 2020-12-23 13:58

    One important point you may be missing is that you have to Run Visual Studio as adminsitrator (right vlick VS icon and select 'Run as Administrator'. I have been strugling with this SSL problem and after by running VS as adminstrator I made it work.

    0 讨论(0)
  • 2020-12-23 14:05

    Property Settings

    I unfortunately had the same issue, couldn't see the "enable SSL" checkbox in the Debug tab of the Project's properties... Finally found it! --> Set the launch on "IIS Express", then you will be able to select it ;-)

    0 讨论(0)
  • 2020-12-23 14:06

    For those running asp.net core 1.x in Visual Studio 2017 RC, you should be able to change the "sslPort": 0 line in the launchSettings.json file to whatever port number you would like to use for SSL. This effectively changes the bindings in the .\vs\config\applicationhost.config file mentioned in the previous answers.

    0 讨论(0)
  • 2020-12-23 14:08

    For Visual Studio 2019 and 2017:

    1. In Solution Explorer, right click the project > Properties
    2. Select the Debug Tab
    3. Check Enable SSL
    0 讨论(0)
  • 2020-12-23 14:13

    Editing the .\vs\config\applicationhost.config actually worked for me.

    <site name="Filters" id="2">
      <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="c:\Users\Ashley\documents\visual studio 2017\Projects\Filters\src\Filters" />
      </application>
      <bindings>
        <binding protocol="http" bindingInformation="*:51107:localhost" />
        **<binding protocol="https" bindingInformation="*:43107:localhost" />**
      </bindings>
    </site>
    

    It does however load the app up in the browser using the non-https port by default. If you manually point your browser to the 43107 port it should work.

    Edit

    This worked for me a few times but stopped working. Subsequent testing revealed that whenever I would click the button to start debugging in VS 2017 RC it would remove the binding I manually added.

    I fixed that by making the file read-only now it's starting with HTTPS support again.

    0 讨论(0)
提交回复
热议问题