gpt4 book ai didi

c# - 更改 launchSettings.json 中的端口会导致到达 "This site can’”

转载 作者:行者123 更新时间:2023-12-03 21:27:25 25 4
gpt4 key购买 nike

我使用 VS2017 创建了一个空的 asp.net 核心应用程序。我唯一改变的是"sslPort": launchSettings.json 文件中的属性。
当我点击运行 IIS Express chrome 时,网址为 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"
}
}
}
}

我究竟做错了什么?

最佳答案

docs 中所述,您在 IIS Express 中使用了不兼容的 ssl 端口。
而不是 "sslPort": 9995 , 替换为 44300 到 44399 之间的端口号。

If you want to test SSL access to your site, you can do this with IIS Express by using an SSL port between 44300 and 44399 and using the IIS Express self-signed certificate. Trying to use SSL with a port outside this range results in a URL binding failure when your website is launched under IIS Express.

关于c# - 更改 launchSettings.json 中的端口会导致到达 "This site can’”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54769960/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com