9

I have IIS on my development machine and I host default asp.net 4.5 website and .NET core application.

Applications are configured to work only via https. And sometimes, without any pattern "https" disappears from the configuration list. In this cases I add it manually but this is really annoing.

Any clues who can remove this binding all the time?

enter image description here

Ievgen
  • 4,261
  • 7
  • 75
  • 124
  • 1
    See if this helps https://blogs.msdn.microsoft.com/saurabh_singh/2010/05/11/ssl-bindings-are-randomly-getting-deleted-for-a-website-with-error-ssl-certificate-settings-deleted-for-port-x-x-x-x443-in-the-event-logs-iis-7-07-5/ – SoConfused Aug 15 '18 at 14:59
  • 1
    Since it is on a development machine, check if the projects you open in Visual Studio frequently do overwrite IIS defaults and break the bindings. – Lex Li Aug 15 '18 at 20:47
  • 2
    This happens to me when I start debugging an ASP.NET Core project that uses IIS integration in Visual Studio. Haven't figure out how to prevent this. – John Allers Jun 20 '19 at 12:45
  • 1
    This issue has something to do with debugging .Net Core apps in visual studio. It started to occur after i enabled "Development time IIS support" in the visual studio installer and started debugging .Net core apps in visual studio. Yet to find the cause. – Squibly Oct 15 '19 at 04:57

1 Answers1

13

Open launchSettings.Json and set the sslPort for iis to 443

  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iis": {
      "applicationUrl": "http://localhost/",
      "sslPort": 443
    },
    "iisExpress": {
      "applicationUrl": "http://localhost:54633",
      "sslPort": 0
    }
  },
Crater
  • 349
  • 4
  • 5
  • This is a solution for the Visual Studio Code? Because the problem happened with the Visual Studio. – Ievgen Dec 12 '19 at 11:27
  • 1
    This is how I fixed the issue using Visual Studio Professional 2017 – Crater Dec 12 '19 at 16:33
  • This solved my problem! I'm using Visual Studio 2022. I had sslPort set to 0. Changing it to 443 stopped IIS from deleting the https binding. – Garrett Banuk Mar 14 '23 at 17:43
  • I had this problem in Visual Studio 2022. I had sslPort set to 0 and I would randomly loose my https bindings in IIS. Changing the port to 443 fixed that. – Garrett Banuk Mar 27 '23 at 19:30