Attaching to a child process automatically in Visual Studio during Debugging

风格不统一 提交于 2019-11-27 18:30:29

I would use a macro. I've redefined my F5 function to attach to the asp.net process instead of the long build/validate it usually performs. This works pretty well for me and it's really easy.

    For Each process In DTE.Debugger.LocalProcesses
        If (process.Name.IndexOf("aspnet_wp.exe") <> -1) Then
            process.Attach()
            Exit Sub
        End If
    Next
Mike Chamberlain

For VS2012, macros have been dropped, but you can still do it quite quickly with standard keyboard shortcuts. For instance, to attach to iisexpress.exe:

Ctrl + Alt + p - brings up the Attach To Process dialog

i - jumps to the the first process beginning with i in the list (for me this is iisexpress.exe)

Enter - attaches

For super speed, you can also Turn off Visual Studio Attach security warning when debugging IIS.

Pablo Retyk

Check out the VisualStudio plugin that I wrote, named Lazy.

I was debugging a C++ plugin in an externally spawned process that crashed by throwing an exception at startup and this worked perfectly for me:

Add the free Reattach Extension for Visual Studio. Ask it to reattach to the process name before it is launched. It will pop a modal dialog saying it is waiting for the process name to launch.

Now launch the process and the Visual Studio debugger will attach immediately, catching exceptions and hitting breakpoints.

(This was also in a media plugin, the exception was normally caught and rethrown by the host process in a Delphi context so I needed to break before that happened).

You can automatically attach to a process by pressing F5, if you setup something like that in visual studio:

http://vvcap.net/db/ujYL7zeN_n_RgeprqCSM.htp

notice: There's "Command" filled up as an executable name, and "Attach" must be "yes"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!