【发布时间】:2019-10-24 11:46:36
【问题描述】:
出于某种原因,Visual Studio 2017(版本 15.9.12)拒绝以非 ssl 加载 ASP.Net Dotnet Core 2.2 页面。即使未选中 Enable SSL 并且启动浏览器路径设置为 http://localhost:15777(或者对于 Kestrel,它已设置),它也会自动将 s 附加到 http,如 https://localhost:15777 http://localhost:55333)。
launchSettings.json 文件如下所示(如您所见,它设置正确,但完全被忽略)。
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:15777",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "http://localhost:15777",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Nop.Web": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:55333"
}
}
}
这个,一周前没有这样做,我到处搜索帖子寻找答案。显然,某处存在错误,因此我正在寻找一种方法来使 Visual Studio、IIS Express 或 Kestrel 像预期的那样工作。 有什么想法吗?
【问题讨论】:
-
我看到了,但是对于 Core 2.2,一切都变了。仍在试图弄明白为什么 Core 2.2 如此糟糕 - 以前从未遇到过如此荒谬的问题。
-
“一切都改变了”是模糊的。该线程有几个即使对 3.0 也有效的答案(例如
.UseUrls("http://localhost:5000"))。
标签: asp.net-core .net-core visual-studio-2017 iis-express kestrel-http-server