通过互联网的远程调试器(远程IP机器)
我的设置: 本地电脑:x86 vista &视觉工作室 客户端服务器:x64服务器(静态IP)。
目前我使用远程桌面与其连接。远程调试器作为服务运行,并且有一个具有作为服务登录权限的用户名。
我可以为此设置配置远程调试器吗?
指导、经验会让我的生活不再像地狱一样。谢谢。
My setup:
Local PC: x86 vista & visual studio
Client server: x64 server ( static ip ).
Currently I connect with it using Remote desktop. Remote Debugger is running as service and there is a user name with login as service privilege.
Can I configure remote debugger to this setup?
Guides, experiences will make my life little less of a hell. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我也遇到了类似的问题,就像 Hans Passant 上面所说的那样,VPN 是必要的。我能够通过执行以下操作附加到该进程并通过 Internet 进行调试:
注意:我在两台计算机上以完全相同的用户身份登录,并且每台计算机上都有相同的密码。
我希望这对那里的人有帮助。
I had a similar problem, and like Hans Passant said above, a VPN is necessary. I was able to attach to the process and debug over the internet by doing the following:
Note: I was logged in as the exact same user on both machines and had the same password on each.
I hope that helps someone out there.
对我来说,它只是通过公共 IP 地址工作。确保 Visual Studio 远程工具在安装时将为所有相关网络打开防火墙端口。列出进程时还要确保连接目标公共 IP 地址与 TCP 端口一起写入(VS2019 默认为 4024)。
For me it just worked over a public ip address. Ensure Visual Studio remote tools will open firewall ports for all relevant networks when installing. Also ensure the connection target public IP address is written with the TCP port (the default for VS2019 is 4024) when listing processes.
无需第 3 方应用程序!
(我建议遵循本教程,特别是标题为“设置远程调试器”的底部部分)。不过,简单地说,在远程计算机上安装
远程调试工具
后,使用管理员权限运行它,然后:打开
Windows防火墙
设置页面点击
高级设置
,会出现这样的窗口:点击
入站规则->新建规则
并在以下页面中进行选择:- [规则类型]
自定义
- [程序]
特定程序
(并选择:C:\Program Files\Visual Studio\Common7\IDE\Remote Debugger\x64\msvsmon.exe
或其他是您的正确路径,另请注意x86/x64
您想要的路线)- [协议和端口] 单击
下一步
跳过该页面(或者为了获得最大安全性,您实际上可以选择远程调试器
窗口显示的确切端口)- [范围] 在第二个字段(其中显示
Which REMOTE IP..
)中选择您当前的 IP 地址- [操作]
允许连接
- [简介] 下一步
- [名称] 您想要识别的任何 slug,即
我的 VS 规则
您可能需要的最后一步是为远程计算机上的文件夹设置连接(硬链接)正确解析应用程序文件:
* 连接远程桌面时,从
本地资源>共享驱动器
更多>>驱动器> C
* 连接后,在远程“我的电脑”上将出现您的“映射驱动器”并复制其位置(即
\\RobertoPC\
)。然后使用管理员权限打开CMD
并执行:mklink /DC:\my_folder \\RobertoPC\C\my_folder
在本地 PC
C: 驱动器创建一个文件夹
my_folder
并将项目放入该文件夹中,并使用远程调试选项运行项目:No 3rd party apps needed!
(I advise to follow this tutorial, especially the bottom part titled "Set up the remote debugger"). However, to say shortly, after installing
Remote Debugging Tools
on remote machine, run it with administrator privilegges and then:Open up
Windows Firewall
settings pageClick
Advanced Settings
and there will show up such window:Click
Inbound Rules->New Rule
and choose on the following pages:- [Rule Type]
Custom
- [Program]
Specific program
(and choose :C:\Program Files\Visual Studio\Common7\IDE\Remote Debugger\x64\msvsmon.exe
or whatever is your correct path, also notex86/x64
your desired route)- [Protocol and Ports] Skip that page by clicking
Next
(or for maximum security, you can actually choose the exact port thatRemote Debugger
window is showing)- [Scope] Choose in the second field (where it says
Which REMOTE IP..
) your current IP address- [Action]
Allow connection
- [Profile] Next
- [Name] whatever slug you want to identify, i.e.
My rule for VS
The last step what you might need, is to set the Junction (hardlink) for folder on remote machine to correctly resolve the application files:
* When connecting with Remote-Desktop, share drive from
Local Resources > More > Drives > C
* After you connect, on remote "My PC" there will appear your "mapped drive" and copy it's location (i.e.
\\RobertoPC\
). Then openCMD
with admin privilegges and execute:mklink /D C:\my_folder \\RobertoPC\C\my_folder
On your local PC
C:
drive create a foldermy_folder
and put the project into that folder, and run the project with remote debugging option:无法引导调试器通过远程桌面进行工作。
查看如何:设置远程调试,特别是“配置Windows 防火墙”部分。您需要确保可以连接到正确的端口,这将需要更改软件和/或硬件防火墙。 VPN 可能是解决方案的一部分(正如 @Hans Passant 在他的评论中建议的那样)。
一个更简单的答案可能是在与您尝试调试的计算机位于同一网络的计算机上安装 Visual Studio。然后,您的调试器正在建立本地连接,而您仍然通过远程桌面与远程网络进行交互。我不确定这是否是一个选择。
There's no way to channel your debugger to work over Remote Desktop.
Check out How to: Set Up Remote Debugging, specifically the "Configuring the Windows Firewall" section. You will need make sure you can connect to the correct ports, which will require Software and/or Hardware firewall changes. A VPN could be part of the solution (as @Hans Passant suggested in his comment).
A simpler answer may be to install Visual Studio on a machine within the same network as where you're trying to debug. Then your debugger is making a local connection and you are still interacting with the remote network via Remote Desktop. I'm not sure if this is an option.