无法启动调试适配器:VS 尝试连接到随机端口
Failed to launch debug adapter: VS tries to connect to a random port
我有一个 asp.net 核心 (.net5) 项目,当我启动它时系统地在延迟后抛出错误,然后关闭调试。
我有以下启动设置:
{
"iisSettings": {
"windowsAuthentication": true,
"anonymousAuthentication": false,
"iisExpress": {
"applicationUrl": "http://localhost:50868",
"sslPort": 44363
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Kestrel": {
"commandName": "Project",
"dotnetRunMessages": "true",
"launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
我在调试模式下以“Kestrel”启动项目
One or more errors occurred.
Failed to launch debug adapter. Additional information may be
available in the output window.
Cannot connect to runtime process, timeout after 10000 ms - (reason:
Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:55743).
当项目设置为在 https://localhost:5001
或 5000 启动浏览器时,它似乎确实尝试连接到 127.0.0.1:55743
之类的随机端口
似乎与此问题有关https://github.com/dotnet/aspnetcore/issues/28113
PS。调试在 Edge 下工作正常(我通常在 Chrome 下工作),我想如果你需要更换浏览器有这样的问题....
我尝试了几种解决方案,不确定哪种解决方案真正有用,但您可以尝试以下一种:
Disable/Enable JavaScript 在 VS 选项中调试:
更改默认启动浏览器以查看是否有帮助(例如,在 Edge 或 Firefox 中启动而不是 Chrome)
取消选中项目调试设置中的“launchbrowser”,启动调试,然后手动打开您的启动程序link(本地主机或您配置启动的其他主机)
打开你的资源监视器并检查你尝试打开的端口是否已经被另一个进程占用(打开任务管理器,转到性能选项卡,然后在底部的 window 你有资源监视器。或者从命令行启动“resmon.exe”。然后转到网络选项卡和最后一个“端口”。
我有一个 asp.net 核心 (.net5) 项目,当我启动它时系统地在延迟后抛出错误,然后关闭调试。
我有以下启动设置:
{
"iisSettings": {
"windowsAuthentication": true,
"anonymousAuthentication": false,
"iisExpress": {
"applicationUrl": "http://localhost:50868",
"sslPort": 44363
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Kestrel": {
"commandName": "Project",
"dotnetRunMessages": "true",
"launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
我在调试模式下以“Kestrel”启动项目
One or more errors occurred.
Failed to launch debug adapter. Additional information may be available in the output window.
Cannot connect to runtime process, timeout after 10000 ms - (reason: Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:55743).
当项目设置为在 https://localhost:5001
或 5000 启动浏览器时,它似乎确实尝试连接到 127.0.0.1:55743
之类的随机端口
似乎与此问题有关https://github.com/dotnet/aspnetcore/issues/28113
PS。调试在 Edge 下工作正常(我通常在 Chrome 下工作),我想如果你需要更换浏览器有这样的问题....
我尝试了几种解决方案,不确定哪种解决方案真正有用,但您可以尝试以下一种:
Disable/Enable JavaScript 在 VS 选项中调试:
更改默认启动浏览器以查看是否有帮助(例如,在 Edge 或 Firefox 中启动而不是 Chrome)
取消选中项目调试设置中的“launchbrowser”,启动调试,然后手动打开您的启动程序link(本地主机或您配置启动的其他主机)
打开你的资源监视器并检查你尝试打开的端口是否已经被另一个进程占用(打开任务管理器,转到性能选项卡,然后在底部的 window 你有资源监视器。或者从命令行启动“resmon.exe”。然后转到网络选项卡和最后一个“端口”。