Why https is disabled on publish in .NET Core 7.0

74 views Asked by At

Explanation

I have Visual Studio v17.9.5. When I publish an existing project or create a new one and publish it, it shows me only the http:5000 port.

It does not run neither on cloud.

500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.

Question

Why is the https port disabled on publish? How can it be enabled?

The output I get when I run the app, after publish:

info: Microsoft.Hosting.Lifetime[14]
  Now listening on: http://localhost:5000

info: Microsoft.Hosting.Lifetime[0]
  Application started. Press Ctrl+C to shut down.

info: Microsoft.Hosting.Lifetime[0]
  Hosting environment: Production

info: Microsoft.Hosting.Lifetime[0]

Launchsettings.json

     {
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:6247",
      "sslPort": 44352
    }
  },
  "profiles": {
    "http": {
      "commandName": "Project",
      "dotnetRunMessages": true,
      "launchBrowser": true,
      "applicationUrl": "http://localhost:5140",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "https": {
      "commandName": "Project",
      "dotnetRunMessages": true,
      "launchBrowser": true,
      "applicationUrl": "https://localhost:7135;http://localhost:5140",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}

On debug i get the following:

enter image description here

On publish i get this :

enter image description here

enter image description here

enter image description here

0

There are 0 answers