Visual studio 2017 忽略VS2017下的Kestrel端口设置
我在从VS2017启动Kestrel服务器时遇到问题。在VS2015的Visual studio 2017 忽略VS2017下的Kestrel端口设置,visual-studio-2017,kestrel-http-server,kestrel,Visual Studio 2017,Kestrel Http Server,Kestrel,我在从VS2017启动Kestrel服务器时遇到问题。在VS2015的launchSettings.json中,我可以这样设置端口: "Kestrel": { "launchUrl": "http://localhost:5010/api", "environmentVariables": { "ASPNETCORE_URLS": "http://localhost:5010" } 现在红隼忽略了这个设置。如果我将设置的名称更改为:“ASPNETCORE\u SERVER.ur
launchSettings.json中,我可以这样设置端口:
"Kestrel": {
"launchUrl": "http://localhost:5010/api",
"environmentVariables": {
"ASPNETCORE_URLS": "http://localhost:5010"
}
现在红隼忽略了这个设置。如果我将设置的名称更改为:“ASPNETCORE\u SERVER.url”
我将收到有关该设置已被弃用的警告,这表明仍在处理launchSettings.json
文件
我还尝试了设置端口设置环境变量(ASPNETCORE\u url
)的其他选项,但仍然可以使用dotnet run--server.urlhttp://0.0.0.0:5010
不行。在VS2017上,类似的东西对我来说很有用
"profiles": {
"Kestrel": {
"commandName": "Project",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:2287"
}
}
在端口2287上运行应用程序也会遇到同样的问题。但是ASPNETCORE_URL对我有用,谢谢!