The process for debugging InfoPath 2010 form templates with code behind has changed quite a bit from InfoPath 2007 thanks to Microsoft not letting us develop our stuff in Visual Studio anymore :-)
Actually there is a really nice MSDN article about Investigating Issues with InfoPath 2010 SharePoint Applications which will surely help you!
There are several things you need to do to enable your forms for debugging (all done in the InfoPath code editor or Visual Studio Tools for Applications):
- Build in Debug mode (Project Properties > Build > Active (Debug)
- Enable full Debug Info (Project Properties > Build > Advanced)
- Clear "Enable Just My Code" and select "Suppress JIT..." (Tools > Options > Debugging)
Then you can deploy your template and attach to either the correct
w3wp process or the
SPUCWorkerProcess for a sandboxed solution - for this you will need to use Visual Studio.
In any case: Make sure you read the MSDN article ;-)