Wednesday, October 21, 2009

Debugging web based infopath forms

Recently a colleague who has been working on Infopath 2007 for quite long time has stated that its not possible to debug web-based infopath at all.

I believe that he came to that conclusion due to the fact that Visual Studio Tools for Applications (VSTA) does not show the option "Attach to debugger".

May be there are few others in the same boat as I was (I had been with the same opinion until my friend Sandeep Nahta said that web-based Infopath forms are very likely debuggable). After a bit of research, it has been evident that debugging web-based Infopath forms is not a big deal.

Follow the below steps:
1) Ensure the InfoPath Form Template is compiled in the Debug Configuration so the XSN includes the symbol (PDB) file. (From the Project menu choose Project Properties .Ensure the Configuration option is set to Active(Debug)/Debug)
2) Open the local copy of the code file (make sure not to open the csproj file created by Infopath. Just open the .cs file ONLY) in Visual Studio and set a breakpoint
3) Attach to the appropriate w3wp process
4) Execute the process that will cause the breakpoint to be hit

Ref: http://blogs.msdn.com/infopath/archive/2006/11/24/debugging-browser-forms.aspx

No comments:

Post a Comment