问题
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.
- Open the properties of the project
- Select the
debug
tab on the left - 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