---
title: "A macro to automatically attach to aspnet_wp.exe"
url: "https://osherove.com/blog/2003/9/21/a-macro-to-automatically-attach-to-aspnet_wpexe.md"
canonical: "https://osherove.com/blog/2003/9/21/a-macro-to-automatically-attach-to-aspnet_wpexe.html"
published: "2003-09-21T19:36:00"
updated: "2003-09-21T19:36:00"
tags: [".Net Quotations", "Tips & Tricks"]
author: "Roy Osherove"
description: "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…"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# A macro to automatically attach to aspnet\_wp.exe

By Roy Osherove September 21, 2003 In [.Net Quotations](https://osherove.com/blog/category/net-quotations), [Tips & Tricks](https://osherove.com/blog/category/tips-tricks)

**Historical article** · Originally published September 21, 2003; technical details may be outdated.

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

A macro to automatically attach to aspnet\_wp.exe, written by [Kevin Dente](http://weblogs.asp.net/kdente/) 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>

## More in .Net Quotations

[All posts in .Net Quotations](https://osherove.com/blog/category/net-quotations)

- Sep 23, 2003

    ### [For a good time, call 1-800-FAULT-INJECTION-TESTING](https://osherove.com/blog/2003/9/23/for-a-good-time-call-1-800-fault-injection-testing.html)

- Sep 22, 2003

    ### [NAnt-addin: another coolness in the making?](https://osherove.com/blog/2003/9/22/nant-addin-another-coolness-in-the-making.html)

- Sep 19, 2003

    ### [Data Access application block v3.0 has some good stuff](https://osherove.com/blog/2003/9/19/data-access-application-block-v30-has-some-good-stuff.html)

- Sep 17, 2003

    ### [A glimpse into the future](https://osherove.com/blog/2003/9/17/a-glimpse-into-the-future.html)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
