Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I prefer to do the exact same thing and it <strong>IS</strong> possible to bind it all to a keystroke with a macro.</p> <p>Goto Tools > Macros > Macro IDE</p> <p>Add a new module and use this code (the funky comments are for syntax highlighting)</p> <pre><code>Imports System Imports EnvDTE Imports EnvDTE80 Imports EnvDTE90 Imports EnvDTE90a Imports EnvDTE100 Imports System.Diagnostics Imports System.Collections.Generic Public Module AttachingModule Sub AttachToAspNET() Try Dim process As EnvDTE.Process Dim listProcess As New List(Of String) '' // uncomment the processes that you'd like to attach to. I only attach to cassini '' // listProcess.Add("aspnet_wp.exe") '' // listProcess.Add("w3wp.exe") listProcess.Add("webdev.webserver") For Each process In DTE.Debugger.LocalProcesses For Each procname As String In listProcess If process.Name.ToLower.IndexOf(procname) &lt;&gt; -1 Then process.Attach() End If Next Next Catch ex As System.Exception MsgBox(ex.Message) End Try End Sub End Module </code></pre> <p>Click on File > Close and return</p> <p>Click on Tools > Options</p> <p>Click on Environment > Keyboard</p> <p>I put the macro in MyMacros, so I look for "Macros.MyMacros.AttachingModule.AttachToAspNET" in the "Show Commands Containing" textbox".</p> <p>I prefer to use <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>D</kbd> but put whatever you want in the "Press Shortcut Keys" textbox and click Assign, then OK</p> <p>Now all you have to do is hit <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>D</kbd> to attach to all cassini instances.</p> <p>I've seen various versions of this around the internets and <a href="https://stackoverflow.com/questions/2512935/visual-studio-attach-to-particular-instance-of-the-process-macro">this</a> was the most recent I found. I had to modify that slightly to remove the extra web processes and to drop the .exe from <code>WebDev.WebServer.exe</code>, so that it would debug .net 4.0 instances of cassini.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload