簡體   English   中英

更改launchSettings.json中的端口會顯示“無法訪問此站點”

[英]Changing port in launchSettings.json gives “This site can’t be reached”

我使用VS2017創建了一個空的asp.net核心應用程序。 我唯一更改的是launchSettings.json文件中的"sslPort":屬性。 當我單擊運行時,IIS Express chrome將以URL https://localhost:9995/打開,並顯示This site can't be reached The connection was reset. 錯誤

我的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"
      }
    }
  }
}

我究竟做錯了什么?

文檔中所述,您將不兼容的端口用於IIS Express的ssl。 代替"sslPort": 9995 ,將端口號替換為44300和44399之間。

如果要測試對站點的SSL訪問,則可以使用IIS Express,方法是使用44300和44399之間的SSL端口並使用IIS Express自簽名證書。 在IIS Express下啟動網站時,嘗試將SSL與超出此范圍的端口一起使用會導致URL綁定失敗。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM