Jul 16 2010
Debug IIS Macro for Visual Studio
This is an old article and the information contained within it may be out of date, not reflect my current views and/or contain broken links. If you feel this article is still valid and requires updating, you can use the contact form to let me know. However, I make no guarantee that it will get updated.
This is a little macro that you can use in Visual Studio to make it easy to attach to the w3wp processes that are spawned by IIS:
Public Sub AttachToWebServer()
Dim process As EnvDTE.Process
For Each process In DTE.Debugger.LocalProcesses
System.Diagnostics.Debug.Print(process.Name)
If (Path.GetFileName(process.Name).ToLower() = "w3wp.exe") Then
process.Attach()
End If
Next
End Sub
I should point out that in Windows 7 and Windows Server 2008 you will need to run Visual Studio as Administrator, or disable UAC.
Thanks just wat I googled for “debug iis macro” top hit.
Thanks for that snippet.
Wodld be cool, if you could show how to integrate the click on “run with debug” in the macro