C# 在launchSettings.json中更改端口会给出;这个网站可以’;“联系不到”;

C# 在launchSettings.json中更改端口会给出;这个网站可以’;“联系不到”;,c#,asp.net,.net,.net-core,C#,Asp.net,.net,.net Core,我使用VS2017创建了一个空的asp.net核心应用程序。我唯一更改的是launchSettings.json文件中的“sslPort”:属性。 当我单击run IIS Express时,chrome将打开urlhttps://localhost:9995/并给出无法访问此站点的消息连接已重置。错误 My launchSettings.json如下所示 { "iisSettings": { "windowsAuthentication": false, "anonymou

我使用VS2017创建了一个空的asp.net核心应用程序。我唯一更改的是launchSettings.json文件中的
“sslPort”:
属性。 当我单击run IIS Express时,chrome将打开url
https://localhost:9995/
并给出
无法访问此站点的消息连接已重置。
错误

My launchSettings.json如下所示

{
  "iisSettings": {
    "windowsAuthentication": false, 
    "anonymousAuthentication": true, 
    "iisExpress": {
      "applicationUrl": "http://localhost:39566",
      "sslPort": 9995
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "JccWeb2": {
      "commandName": "Project",
      "launchBrowser": true,
      "applicationUrl": "https://localhost:5001;http://localhost:5000",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}
我做错了什么?

如中所述,您使用的ssl端口与IIS Express不兼容。 替换为介于44300和44399之间的端口号,而不是
“sslPort”:9995

如果要测试对站点的SSL访问,可以通过使用介于44300和44399之间的SSL端口并使用IIS Express自签名证书,在IIS Express中执行此操作。在IIS Express下启动网站时,尝试将SSL与此范围之外的端口一起使用会导致URL绑定失败


你是对的。必须将端口更改为上述范围内的端口