How to enable SSL for IIS Express in VS2015

最后都变了- 提交于 2019-12-13 12:53:13

问题


I feel like I must be missing something easy, but does anyone know how to enable SSL for IIS Express when using an ASPNET5 web project? The Project Properties Debug screen only shows a port, not a URL ("classic" web projects still allow you to specific https in the url)


回答1:


Edit your applicationhost.config in [SOLUTION_DIR]\.vs\config

for exemple in the sites section :

<site name="YOUR SITE NAME" id="1">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
      <virtualDirectory path="/" physicalPath="YOUR SITE PATH" />
    </application>
    <bindings>
      <binding protocol="http" bindingInformation="*:80:localhost" />
      <binding protocol="https" bindingInformation="*:44300:localhost" />
    </bindings>
</site>



回答2:


This can be done simply if you click on the project in the Solution Explorer the open the Properties and set the SSL Enabled to True.




回答3:


You do this in a vNEXT project almost exactly the same as prior projects. Microsoft just moved the settings to the debug tab of the project properties.

  1. Open the properties of the project
  2. Select the debug tab on the left
  3. Tic the checkbox for Enable SSL

If yout don't have the above option

Click the project root node in the explorer window, press F4 and adjust the following:




回答4:


Click on the project and press F4, it will show the same properties list as previous visual studio versions where you can set SSL to true.

It will look like this in VS 2015




回答5:


None of the solutions above apply if you are doing .Net 4.5 MVC project with "on premise", aka, ADFS authentication. If so, you won't see a 'debug' tab (see image below). You won't see an "Enable SSL" toggle box. Everything is done automatically by the IDE as long as you select a port in the acceptable range. I used the port 44300 and VS configured the /.vs/config/applicationhost.config file automatically (see below). I think VS might automatically setup SSL with the other authentication types (OAuth, etc.), but I haven't tested it.



来源:https://stackoverflow.com/questions/28933671/how-to-enable-ssl-for-iis-express-in-vs2015

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