InfoPath: Debugging and Setting up a App.config

The below article explains how to setup a your InfoPath environment for local debugging...

http://support.microsoft.com/kb/555963