Visual Studio 远程调试扩展性
我正在尝试使用类似于以下的代码连接到远程计算机:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将调试代码包装为 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.