Visual Studio-附加到进程快捷方式 [英] Visual Studio - Attach to process shortcut

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

问题描述

当我想调试时,我必须执行Debug-> Attach to Process->在列表中查找一个进程-> Attach.

When I want to debug I have to do Debug->Attach to Process -> Look for a process in the list -> Attach.

我想知道是否可以创建某种快捷方式来为我执行此操作?

I was wondering if I can create some kind of a shortcut to do this for me?

推荐答案

最简单的方法是编写一个宏,该宏可以找到要定位的DTE.LocalProcess并自动附加.例如

The easiest way to do this is to write a macro which finds the DTE.LocalProcess you wan to target and automatically attach. For example

Public Sub AttachShortcut()
  For Each proc In DTE.Debugger.LocalProcesses 
    If proc.Name = "what you're looking for" Then
      proc.Attach()
      Exit Sub
    End IF
  Next
End Sub

注意:此堆栈溢出问题是相关的,并且有一个示例可能对您有用

Note: This Stack Overflow Question is related and has a sample you may find useful

这篇关于Visual Studio-附加到进程快捷方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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