在 Visual Studio 2019 中自动附加到多个进程 [英] Automating attaching to multiple processes in Visual Studio 2019

查看:64
本文介绍了在 Visual Studio 2019 中自动附加到多个进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的调试,我必须附加到许多流程实例:

For my debugging I have to attach to many process instances:

  1. 我们应用的 EXE.
  2. 5 个其他进程的实例(我们称之为foo").
  3. 8 个其他进程的实例(我们称之为bar").
  4. 其他过程的 41 个实例(为了纪念暮光之城一集来自爱的艾格尼丝",我们称之为艾格尼丝").

与其必须按住 Ctrl 键选择所有这些,然后单击附加",还有我可以定义的某种模板吗?:

Rather than having to Ctrl-select all of them and then click "Attach", is there some sort of template I can define that will say?:

  1. 附加到 EXE 中称为whatever".
  2. 名为foo"的进程的所有实例.
  3. 名为bar"的进程的所有实例.
  4. 名为Agnes"的进程的所有实例.

推荐答案

你可以使用我的 Visual Commander 使用如下代码自动执行的扩展:

You can use my Visual Commander extension to automate it with code like:

foreach(Process proc in DTE.Debugger.LocalProcesses)
{
    if(proc.Name.ToString().EndsWith("foo.exe"))
    {
        proc.Attach();
    }
}

参见 附加到 Visual Studio 中的特定进程快捷方式 了解更多详情.

See Attach to specific Process shortcut in Visual Studio for more details.

这篇关于在 Visual Studio 2019 中自动附加到多个进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆