Answered by:
Cannot run IIS Express from Visual Studio (with https)

Question
-
User1434241939 posted
I am a long time WebForms user who has never had a problem running an application from the 'IIS Express (Google Chrome)' drop-down on the VS menu bar. I'm using VS 2019 Community Edition.
I've been trying to learn MVC and can't even get Visual Studio to run the program that it builds and scaffolds itself. When I click the same IIS Express as before, I get a browser window with the address https://localhost:44330/, that gives ERR_CONNECTION_RESET. This seems to have something to do with selecting 'Configure for https' during setup, because when I don't select this, I can run the code just fine.
I can get around this when I create an ASP.NET Core application but not when I create an ASP.NET Web Application (.NET FrameworK)
With a Core application, Visual Studio creates a 2nd item on the drop down (under IIS Express) with the solution name. So although I've never gotten the IIS Express button to successfully run the program, I've been able to select the solution name and run the code (it creates a command window along the way). I would rather use .NET Core, but my web hosting company doesn't support it yet.
Why is this happening and how do I overcome it? Is there some setting buried deep down in a configuration file somewhere that I'm missing? /Why would Microsoft create scaffolded code that won't run? I'm guessing the answer is that it protects me somehow,
Thursday, April 23, 2020 7:47 PM
Answers
-
User288213138 posted
Hi stevebo,
I get a browser window with the address https://localhost:44330/, that gives ERR_CONNECTION_RESET. This seems to have something to do with selecting 'Configure for https' during setup, because when I don't select this, I can run the code just fine.Why is this happening and how do I overcome it? Is there some setting buried deep down in a configuration file somewhere that I'm missing? /Why would Microsoft create scaffolded code that won't run?This problem may be caused by the certificate, because you don't select 'Configure for https' during setup.
To fix problems with the IIS Express certificate, select Repair from the Visual Studio installer. For more information, see this GitHub issue.
Best regards,
Sam
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, April 24, 2020 6:48 AM
All replies
-
User475983607 posted
I'm not sure what you're doing but you can enable SSL in Visual Studio by selecting the project in the solution explorer. Then in the properties Window, find SSL Enable and select true. All you have to do is start the project. I like to use ctrl-F5 or from the Debug menu -> Start without Debugging. This will keep the app running. When you run the project (F5) the host shuts down when the debugger stops.
Thursday, April 23, 2020 8:17 PM -
User288213138 posted
Hi stevebo,
I get a browser window with the address https://localhost:44330/, that gives ERR_CONNECTION_RESET. This seems to have something to do with selecting 'Configure for https' during setup, because when I don't select this, I can run the code just fine.Why is this happening and how do I overcome it? Is there some setting buried deep down in a configuration file somewhere that I'm missing? /Why would Microsoft create scaffolded code that won't run?This problem may be caused by the certificate, because you don't select 'Configure for https' during setup.
To fix problems with the IIS Express certificate, select Repair from the Visual Studio installer. For more information, see this GitHub issue.
Best regards,
Sam
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, April 24, 2020 6:48 AM -
User1434241939 posted
select Repair from the Visual Studio installerWhen I went to the installer, it told me there were updates available. After downloading and installing the updates, the problem vanished! So thank you very much!
That said, can you explain the difference between running with IIS Express and ASB (the project name)? I think the difference is that using the project name compiles for any platform not just IIS, but I'm not sure. Anyway, before the update only ASB was running the code, but now IIS Express does too.
Friday, April 24, 2020 10:33 AM -
User475983607 posted
That said, can you explain the difference between running with IIS Express and ASB (the project name)? I think the difference is that using the project name compiles for any platform not just IIS, but I'm not sure. Anyway, before the update only ASB was running the code, but now IIS Express does too.It starts kestrel (console) which hosts the ASP.NET Core web application. Same as dotnt run.
Friday, April 24, 2020 11:16 AM -
User1434241939 posted
Now that I've updated VS 2019, I can no longer create an asp.net web application (.net framework)!
To address this, I installed .NET Framework 4.7.1 using 'modify', but that didn't install a .NET Framework project template.
All I'm trying to do is create an MVC project (anything at all!) that will run on my ISP. The ISP does not support Core yet, so that's why I am trying to create a non-core version. But I can't because the template has disappeared from the options available. (Please excuse me if my terminology is wrong, I am having a hard time keeping the dozens of options VS offers straight).
Friday, April 24, 2020 11:53 AM -
User475983607 posted
Now that I've updated VS 2019, I can no longer create an asp.net web application (.net framework)!
To address this, I installed .NET Framework 4.7.1 using 'modify', but that didn't install a .NET Framework project template.
All I'm trying to do is create an MVC project (anything at all!) that will run on my ISP. The ISP does not support Core yet, so that's why I am trying to create a non-core version. But I can't because the template has disappeared from the options available. (Please excuse me if my terminology is wrong, I am having a hard time keeping the dozens of options VS offers straight).
The project should be there. Maybe you filters the project list and can't see the .NET project templates? Or maybe you just need to scroll down a bit?
Friday, April 24, 2020 12:34 PM