Non proprio elegante come la risposta di Jaco (non si è mai reso conto che si potevano avere più progetti di avvio), ma potrebbe essere piuttosto utile. Ho un macro VS:
Function AttachToProcess(ByVal procname As String, ByVal quiet As Boolean) As Boolean
Dim attached As Boolean = False
Dim proc2 As EnvDTE80.Process2
' Attaching natively, from http://blogs.msdn.com/jimgries/archive/2005/11/30/498264.aspx '
Dim dbg2 As EnvDTE80.Debugger2 = DTE.Debugger
Dim trans As EnvDTE80.Transport = dbg2.Transports.Item("Default")
Dim dbgeng(1) As EnvDTE80.Engine
dbgeng(0) = trans.Engines.Item("Native")
For Each proc2 In DTE.Debugger.LocalProcesses
If (proc2.Name.Contains(procname)) Then
proc2.Attach2(dbgeng)
attached = True
Exit For
End If
Next
If (attached = False And quiet = False) Then
MsgBox(procname + " is not running")
End If
Return attached
End Function
Sub AttachToMyProcess1()
AttachToProcess("MyProcess1.exe", True)
End Sub
Sub AttachToMyProcess2()
AttachToProcess("MyProcess2.exe", True)
End Sub
ho quindi fissare il AttachToMyProcessX()
macro per le scorciatoie da tastiera. Questo ha il vantaggio che è possibile allegare a un processo in modo retrospettivo: premendo Ctrl-F5 quindi il collegamento è spesso più rapido rispetto all'avvio con F5.
fonte
2009-12-08 22:20:25
Ehi, guardi. Grazie Jaco, non mi ero reso conto che avresti potuto farlo. Bel lavoro :) –
Non lo sapevo neanche! Fantastico, ora per capire dove ne ho bisogno; p – leppie