.net - How can I make a Visual Studio Macro to attach the debugger to all instances of w3wp.exe? -


I'm usually developing web applications, and my work is a surprisingly "Ctrl + Alt + P" To sort matters out, I'm working on an app that spreads many application pools, sorting by process name, sorting w3wp.exe to attach to my debugger. So I usually have 2 or 3 examples of W3wp.exe, and it is impossible to know which one to attach, so I have to In essence, I attach all those who are redundant but work.

Everything, it is very upset.

My colleague has drawn a way to automatically attach a VS macro to w3wp.exe (it's basically entered):

  Sub-attack Macro () Dim dbg2 as EnvDTE80.debugger2 = DTE.Debugger dim as EnvDTE80.Transport = dbg2.Transports.Item ("default") dim dbengeng (3) EnvDTE80 as .ngin dbgeng (0) = Trans.Engines.Item ("T Esc Uel ") Dbgeng (1) = trans.Engines.Item (" T-SQL ") Dibiana g (2) = trans.Engines.Item (" managed ") as dim proc2 EnvDTE80. Process 2 = dbg2.GetProcesses (trans, "ENIAC"). Hold item ("w3wp.exe") as proc2.Attach2 (DBAG) System.Exception MsgBox (ex.Message) End Try End Sub  

I'm not sure that all are necessary or anything, I have not made macro VS, I have to start from where do actually know.

Rather than be a way to modify the macro so that attach to w3wp.exe of one Example themselves, all < / strong> example

  sub MacroAttachToAllProcesses () as dim dbg2 EnvDTE80.Debugger2 = DTE.Debugger as try as dim trans EnvDTE80.Transport = dbg2.Transports.Item ( "default") dim dbgeng (3) EnvDTE80.Engine dbgeng (0) = Trans.Engines.Item ("T-SQL") dbigeng (1) = trans.Engine s.Item ("T-SQL") dbgeng (2) = trans.Engines.Item ("Probe Dit ") in dbg2.GetProcesses for each theprocess EnvDTE80.Process2 (trans," computername ") If TheProcesskNamekContains (" W3wpkexe ") re-processing. ATAQ 2 (DBAGN) is the end if it is in the form of next catch-up system. Option MSBbox (formerly) and end and end  

Comments