通过互联网的远程调试器(远程IP机器)

发布于 2024-11-16 15:49:08 字数 167 浏览 1 评论 0原文

我的设置: 本地电脑: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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

少女情怀诗 2024-11-23 15:49:08

我也遇到了类似的问题,就像 Hans Passant 上面所说的那样,VPN 是必要的。我能够通过执行以下操作附加到该进程并通过 Internet 进行调试:

  1. 在服务器上安装最新的 microsoft 远程调试器。
  2. 在我的本地计算机和服务器上安装 Hamachi 并连接,以便我位于同一网络上。
  3. 在本地计算机的 Visual Studio 上转到“调试”->“附加到进程”,然后输入服务器的 Hamachi IP 地址。
  4. 选择“显示所有用户的进程”并选择有问题的进程。

注意:我在两台计算机上以完全相同的用户身份登录,并且每台计算机上都有相同的密码。

我希望这对那里的人有帮助。

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:

  1. Install the latest microsoft remote debugger on the server.
  2. Install Hamachi on both my local machine and the server and connect so that I was on the same network.
  3. Go to Debug->Attach To Process on my local machine's Visual studios and enter the Hamachi IP address of the server.
  4. Pick "show processes from all users" and pick the process in question.

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.

鯉魚旗 2024-11-23 15:49:08

对我来说,它只是通过公共 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.

enter image description here

灼痛 2024-11-23 15:49:08

无需第 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 page

  • Click Advanced Settings and there will show up such window:
    enter image description here

  • 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 note x86/x64 your desired route)

    - [Protocol and Ports] Skip that page by clicking Next (or for maximum security, you can actually choose the exact port that Remote 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 open CMD with admin privilegges and execute:

    mklink /D C:\my_folder \\RobertoPC\C\my_folder

  • On your local PC C: drive create a folder my_folder and put the project into that folder, and run the project with remote debugging option:

enter image description here

似狗非友 2024-11-23 15:49:08

无法引导调试器通过远程桌面进行工作。

查看如何:设置远程调试,特别是“配置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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文