Enable SSL for your project: View the properties of the project (F4) -> SSL Enabled to True (notice the SSL URL property gets populated) Set your project to start in SSL mode: Go to Project Properties (Alt+Enter), select the Web tab and modify the Project Url to the one from step 3. E.g. https://localhost:44300.
I typically run appwiz. cpl to launch the old control panel applet and run repair from there. Windows 7 and 8.1: After going to Add/Remove Programs and choosing the "Repair" option on IIS Express, the certificate has been reinstalled and I can now launch IIS Express sites using HTTPS.
After you've set a project to use IISExpress, press F4
while the project is selected on the solution explorer to bring up the properties and in the properties set SSL Enable
set true
and under SSL URL
set the URL with the port (443 in your case) you want for the SSL.
This works for me without going under the hood and the self signed certificate was automatic.
To run the project on that URL by default, you can right click on the project, select properties, then Web and replace the Project Url with https://localhost:443
If you have followed jbtule's steps and SSL is still not working, ensure that your port is in the format :443XX
.
Visual Studio did this automatically for the first project I enabled SSL on, but any subsequent projects seem to have random SSL ports. Changing it to the above 443 structure under the Project > Web
UI got it up and working for me.
I stumbled across the answer.
In step 6, I was modifying the wrong IIS Express application.config file. It turns out there is a "master" config file in the application's home directory (e.g., C:\Program Files (x86)\IIS Express\AppServer
, on my system), which is the one I modified.
The second and correct file to modify is the one in the User data area (e.g., C:\Users\Mark.ARCABAMA\Documents\IISExpress\config
, on my system).
I recently had a very similar problem with VS 2019 and IIS Epress. I tried to change the http to https so that I could use ADFS. (Msg : This site is unreachable localhost does not allow connection).
After a little more research, I tried to switch the 'Require SSL' property from true to false and back to true. This triggered an update to the applicationhost.config file (... . Vs \ ProjectName \ config \ applicationhost.config) that created a new SSL binding with a new port number for the https protocol. So, I modified all the links with the proposed new port (in the web property of the project, the config file and the ADFS config) and it works. Conclusion, it is not necessary that the http port is the same as https same for the same site.
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