VS2013 ASP.NET 專案在 PC 上使用 https://localhost:50697/index 正常運行,手機同網段輸入 https://110.64.91.247:50697/index 回傳 HTTP 400 錯誤。
localhost,拒絕外部 IP 存取"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "index",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://*:50697" // 關鍵:綁定所有介面
}
}
dotnet run --urls "https://*:50697"
chrome://inspect無需實體手機,Chrome DevTools 內建裝置工具列(Ctrl+Shift+M)可模擬各機型解析度、User-Agent、觸控事件,並支援網路節流模擬弱網環境,除錯效率遠高於實機測試。