Debugging Custom Actions in Visual Studio Installer

When writing an installer in Visual Studio 2005, you can't debug the custom actions by starting the debugger by pressing F5 in the usual way. One way is to start the installer and attach to the process when the files have been installed, but you may miss the earliest actions. The way to get the debugger to break at the beginning of the custom action code is to add a breakpoint into the code:

public override void Install(IDictionary stateSaver)

This will launch the following popup; choose Debug:

Debugger message

Then choose the debugger with your installer project loaded:

Debugger message

This will put Visual Studio in debug mode, at the breakpoint in your custom action code. You can step through it and see what it's doing.
16 February 2007