Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System
- Imports EnvDTE80
- Imports EnvDTE90
- Imports System.Diagnostics
- Public Module Module1
- Sub RunAndAttach()
- Try
- Dim dbg As Debugger3 = DTE.Debugger
- Dim trans As Transport = dbg.Transports.Item("Default")
- Dim sysProc As Process = System.Diagnostics.Process.Start(New ProcessStartInfo("C:TempCrashingApp.exe") With {.WorkingDirectory = "C:Temp"})
- Dim proc As EnvDTE90.Process3 = dbg.GetProcesses(trans, "ALLON-PC").Item("CrashingApp.exe")
- If (Not sysProc.HasExited) Then
- proc.Attach()
- proc.Break(False)
- Else
- MsgBox("Process " + proc.Name + " has already has exited.")
- End If
- Catch ex As System.Exception
- MsgBox(ex.Message)
- End Try
- End Sub
- End Module
Add Comment
Please, Sign In to add comment