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号才发布,真的太久了,还好正巧这个时间发布了。

相关推荐
陈逸轩*^_^*1 小时前
idea打不开,idea打不开,Error occurred during initialization of VM
java·ide·intellij-idea
大三开学菜鸟4 小时前
记录一下子模块不被idea加载情况
java·ide·intellij-idea
Tummyiii5 小时前
AutoDL平台租借GPU,创建transformers环境,使用VSCode SSH登录
ide·vscode·ssh
Thomas_Cai5 小时前
vscode(cursor)配置python环境,含远程调试
ide·vscode·python·cursor
即兴小索奇7 小时前
PyCharm 接入 DeepSeek、OpenAI、Gemini、Mistral等大模型完整版教程(通用)!
ide·python·pycharm
*.✧屠苏隐遥(ノ◕ヮ◕)ノ*.✧14 小时前
C语言_数据结构总结8:链式队列
c语言·开发语言·数据结构·链表·visualstudio·visual studio
LuXi_foryou20 小时前
【2025深夜随笔】简单认识一下Android Studio
android·ide·android studio
缘来的精彩20 小时前
Android Studio Gradle 8.0 适配指南
android·ide·android studio
星仔_X20 小时前
Android Studio安装配置
android·ide·android studio
九溪弥烟、21 小时前
VSCode 配置优化指南
ide·vscode·编辑器