Archive for July, 2010

Jul 16 2010

Debug IIS Macro for Visual Studio

Published by under General

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.

2 responses so far