I used a handy macro with keybindings in Visual Studio to attach to Windows XP IIS 5.1:
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports System.Diagnostics
Imports System.IO
Public Module AttachDebugger
' This subroutine attaches to the first IIS Web Server found.
Public Sub AttachToFirstIISWebServer()
Dim process As EnvDTE.Process
For Each process In DTE.Debugger.LocalProcesses
If (Path.GetFileName(process.Name).ToLower() = "aspnet_wp.exe") Then
process.Attach()
Exit Sub
End If
Next
MsgBox("No IIS Server found")
End Sub
End Module
However, with Vista, IIS7 process (w3wp.exe) is not anymore in LocalProcesses, but runs as a service on Windows. How can I attach to a service with a macro?
I work often with quite large solutions and don't want to use F5 to recompile everything every time.
RESOLVED: The macro works ok, I just had a wrong process name first. aspnet_wp.exe with XP, w3wp.exe with Vista.