Visual Studio 远程调试扩展性

发布于 2024-07-08 17:18:34 字数 348 浏览 13 评论 0原文

我正在尝试使用类似于以下的代码连接到远程计算机:

Debugger2 db (Debugger2)dte.Debugger;
Transport trans = db.Transports.Item("Default");
Process2 proc2 = (Process2)db.GetProcesses(trans, "MACHINENAME").Item("SERVICENAME");
proc2.Attach2();

我已经通过远程桌面登录并手动启动调试器使其工作,但我必须保持登录状态。问题是,我不不想保持远程计算机的登录状态。 有没有办法自动启动调试器,类似于我通过 IDE 连接时发生的情况?

I'm trying to attach to a remote machine with code similar to the following:

Debugger2 db (Debugger2)dte.Debugger;
Transport trans = db.Transports.Item("Default");
Process2 proc2 = (Process2)db.GetProcesses(trans, "MACHINENAME").Item("SERVICENAME");
proc2.Attach2();

I've gotten it to work by logging on through remote desktop and manually starting the debugger, but I have to stay logged in. The problem is, I don't want to stay logged into the remote machine. Is there a way to automatically launch the debugger, similar to what happens when I attach through the IDE?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

葬﹪忆之殇 2024-07-15 17:18:34

您可以将调试代码包装为 Windows 服务,在启动时以更高的权限执行。

但是,我不推荐该路线,因为根据经验,我认为这对于最可能需要的东西来说是过度的。 您能否详细说明为什么要自动将调试器附加到远程进程?

我的猜测是您想做一些最适合 WinDbg 的事情。 与这些类似的东西。

但是,没有更多关于您的背景信息正在努力实现,我显然只是猜测。

You could wrap your debugging code as a Windows service that executes at startup with hightened privileges.

However, I don't recommend that route, because based on experience I think it's over-kill for what is most likely needed. Could you expand on why you want to attach a debugger to a remote process automatically?

My guess is that you want to do something that would be best suited for WinDbg. Something similar to these.

But, without more background information on what you are trying to accomplish, I'm obviously just guessing.

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