Visual Studio 2022在配置远程调试服务器时无法连接到OpenEuler24.03

表现为在VS中为OpenEuler24.03创建远程服务器时,界面上直接报主机密钥算法失败,或直接提示无法连接到服务器,导致无法创建远程服务器。

经查询日志发现一些蛛丝马迹

bash 复制代码
09:25:15.2035105 [Info, Thread 53]	liblinux.Local.Services.WslEnumerator: Begin executing: C:\Windows\System32\wsl.exe --list --verbose
09:25:15.3155110 [Info, Thread 170]	liblinux.Local.Services.WslEnumerator: End executing: C:\Windows\System32\wsl.exe; exitcode: -1; duration: 00:00:00.1114873
09:25:15.3155110 [Info, Thread 170]	liblinux.Local.Services.WslEnumerator: Begin executing: C:\Windows\System32\wslconfig.exe /list
09:25:15.4355103 [Info, Thread 170]	liblinux.Local.Services.WslEnumerator: End executing: C:\Windows\System32\wslconfig.exe; exitcode: -1; duration: 00:00:00.1199705
09:25:30.4193743 [Info, Thread 1]	liblinux.RemoteSystemBase: Connecting over SSH to 172.16.0.58:22
09:25:30.4953895 [Info, Thread 1]	liblinux.HostKeyVerifier: Connection failed.
09:25:30.4974055 [Info, Thread 1]	liblinux.HostKeyVerifier: Renci.SshNet.Common.SshConnectionException: An established connection was aborted by the server.
   在 Renci.SshNet.Session.WaitOnHandle(WaitHandle waitHandle, TimeSpan timeout)
   在 Renci.SshNet.Session.<ConnectAsync>d__174.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 Renci.SshNet.BaseClient.<CreateAndConnectSessionAsync>d__52.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 Renci.SshNet.BaseClient.<ConnectAsync>d__32.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 liblinux.HostKeyVerifier.<ConnectAsync>d__24.MoveNext()

关键在这句:

liblinux.HostKeyVerifier: Renci.SshNet.Common.SshConnectionException: An established connection was aborted by the server.

经查发现这是SSH.NET(或VS本身)的一个bug
https://developercommunity.visualstudio.com/t/Ssh-connections-of-Visual-Studio-2022-Pr/10585819?space=8&q=distributing

最后需要将Visual Studio 2022升级到17.13即可解决。
这个bug提出是在2024.2.16。但17.13正式版在2025.2.11号才发布,真的太久了,还好正巧这个时间发布了。

相关推荐
kite01219 小时前
TraeCode 与 TraeWork 合并:AI 时代 IDE 的三种形态与未来开发工具
ide·ade·traework·traecode
weixin_461769409 小时前
VS Code 中创建 Jupyter 文件(.ipynb)
ide·python·jupyter
浪潮IT馆10 小时前
Android Studio 非最新版本下载安装教程
android·ide·android studio
下页、再停留13 小时前
【C#桌面客户端系列学习-8】批量导出数据为csv格式
开发语言·c#·visual studio
VIP_CQCRE13 小时前
Visual Studio 接入 AI 助手:LMLocal × Ace Data Cloud 配置指南
大模型·api·ai编程·visual studio·acedatacloud
慧都小项17 小时前
组件改名,引用同步更新:WebStorm的重构能力用在哪里?
ide·重构·webstorm
下页、再停留17 小时前
【C#桌面客户端系列学习-7】数据查询展示
开发语言·c#·visual studio
水饺编程2 天前
第1章,[Win32 章节]:API 及 内存管理模式
c语言·c++·windows·visual studio
*wait for?2 天前
VScode使用uv-创建python虚拟环境
ide·vscode·编辑器
VIP_CQCRE3 天前
在 Visual Studio 里接入 AI 编程能力:用 Ace Data Cloud + LMLocal 打通 OpenAI 兼容接口
openai·ai编程·visual studio·mcp·ace data cloud