Skip to content

Instantly share code, notes, and snippets.

@johnmcdowall
Created August 4, 2010 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnmcdowall/507853 to your computer and use it in GitHub Desktop.
Save johnmcdowall/507853 to your computer and use it in GitHub Desktop.
Option Strict Off
Option Explicit Off
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports System.Diagnostics
Imports System.Security.Principal
Public Module DebuggingMacros
Sub AttachDebuggerToIis()
Try
Dim dbg2 As EnvDTE80.Debugger2 = DTE.Debugger
Dim trans As EnvDTE80.Transport = dbg2.Transports.Item("Default")
Dim compName As String = WindowsIdentity.GetCurrent().Name
compName = compName.Substring(0, compName.IndexOf("\"))
Dim proc2 As EnvDTE80.Process2 = dbg2.GetProcesses(trans, compName).Item("w3wp.exe")
proc2.Attach2(dbgeng)
Catch ex As System.Exception
MsgBox(ex.Message)
End Try
End Sub
End Module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment