Search The Blog
About this site

@RoyOsherove

Subscribe!

This site aims to connect all the dots of my online activities - from tools, books blogs and twitter accounts, to upcoming conferences, engagements and user group talks.

from 5whys.com
Twitter: @RoyOsherove
My Book: The Art of Unit Testing
Latest Posts
« Where did the desktops disappear? | Main | [Article] Introduction to Test-driven development with NUnit and the NUnit-Add-in »
Sunday
Sep212003

A macro to automatically attach to aspnet_wp.exe

This was on the win-tech-off-topic mailing list:

A macro to automatically attach to aspnet_wp.exe, written by Kevin Dente can save lots of clicking around time:

<quote>

  Sub AttachAspNet()
        Dim process As EnvDTE.Process

        If Not (DTE.Debugger.DebuggedProcesses Is Nothing) Then
            For Each process In DTE.Debugger.DebuggedProcesses
                If (process.Name.IndexOf("aspnet_wp.exe") <> -1) Then
                    Exit Sub
                End If
            Next
        End If

        For Each process In DTE.Debugger.LocalProcesses
            If (process.Name.IndexOf("aspnet_wp.exe") <> -1) Then
                process.Attach()
                Exit Sub
            End If
        Next
    End Sub

Unfortunately, it's not perfect. Process.Attach doesn't let you
specify the program type (CLR, Script, native, etc). I think that it
uses whatever your last selection was in the UI. But don't quote me
on that, it's been a while.

</quote>

PrintView Printer Friendly Version

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>