我正在开发一个在远程 PC 上运行的 C# 应用程序。我有 VPN 连接并使用 RDP 会话,我可以登录到那台计算机。
在那台计算机上,在正在运行的进程旁边,还有两个“msvsmon.exe”进程,在任务管理器中具有以下“命令行”条目:
C:\Program Files\...\Common\IDE\Remote Debugger\x86\msvsmon.exe
C:\Program Files\...\Common\IDE\Remote Debugger\x86\msvsmon.exe /CHILDSERVER 428 "+:4022" {...}
(我想这意味着监控服务器正在运行并且监控服务器正在监听端口 4022。)
我检查了我的应用程序:任务管理器明确指出我的应用程序是32位的,所以
x86
“msvsmon.exe”应该是好的。
在我的本地 PC 上,我尝试打开远程连接,但这似乎不起作用:我使用“默认”连接类型,但在“远程连接”窗口的“查找...”对话框中,我尝试了不同的可能性:
=> 刷新后,所有这些尝试都导致“显示 0 个连接,共 0 个连接”
我打开了 VS 2017 的开发人员命令提示符,我输入了
ping 10.39.50.10
,它清楚地显示了结果(这是正常的,因为我有一个 RDP 会话打开到那台机器)。
我相信远程调试使用了一些不同于常规 TCP/IP 的其他“通信通道”,这意味着我需要改变我的本地 PC 和远程计算机之间的通信,但是我可以使用哪个“通信通道”和哪个命令(在
ping
旁边)以检查通信的可用性?
进一步调试:我已经创建(然后删除)了提到的防火墙规则,但现在我正在处理以下错误消息:
Unable to connect to the Microsoft Visual Studio Remote Debugger
named '10.39.50.10:4022'.
The Remote Debugger was unable to locate a resource dll
(vsdebugeng.impl.resources.dll).
Please ensure that the complete remote debugger folder was copied
or installed on the target computer.
在远程计算机上搜索此文件会得到以下结果:
C:\>dir /S /B vsdebugeng.impl.resources.dll
C:\Program Files (x86)\Microsoft SQL Server Management Studio 19\
Common7\Packages\Debugger\1033\vsdebugeng.impl.resources.dll
=> 为什么找不到那个文件?
(我已经检查过,
msvsmon.exe
进程正在以管理员身份运行(Elevated="Yes"))
显然,你不能依赖“msvsmon.exe”安装,基于SQL server management studio:
我的电脑上安装了Visual Studio,因此我可以找到“msvsmon.exe”:
C:\>dir /S /B msvsmon.exe
C:\...\Microsoft Visual Studio\2017\...\Common7\IDE\Remote Debugger\x86\msvsmon.exe
资源库:
C:\>dir /S /B vsdebugeng.impl.resources.dll
C:\...\Microsoft Visual Studio\2017\...\Common7\IDE\Remote Debugger\x86\1033\vsdebugeng.impl.resources.dll
换句话说:“1033”(英语语言环境)目录存储在“x86”目录下,其中可以找到“msvsmon.exe”。
在远程计算机上,“msvsmon.exe”安装在SQL Server Management Studio下,它有另一种结构(这是错误的):
C:\>dir /S /B msvsmon.exe
C:\...\Microsoft SQL Server Management Studio 19\Common7\IDE\Remote Debugger\x86\msvsmon.exe
C:\>dir /S /B vsdebugeng.impl.resources.dll
C:\...\Microsoft SQL Server Management Studio 19\Common7\Packages\Debugger\1033\vsdebugeng.impl.resources.dll
显然,“msvsmon.exe”查看“1033”子目录以找到资源 dll,因此需要复制整个目录:
C:\>dir /S /B vsdebugeng.impl.resources.dll
C:\...\Microsoft SQL Server Management Studio 19\Common7\IDE\Remote Debugger\x86\1033\vsdebugeng.impl.resources.dll
C:\...\Microsoft SQL Server Management Studio 19\Common7\Packages\Debugger\1033\vsdebugeng.impl.resources.dll
一个,将“1033”目录全部复制到“msvsmon.exe”目录下,解决问题。