Debugging InfoPath 2007 forms in MOSS 2007 Forms Services 

Finally! If you are lucky enough to work with InfoPath 2007 and MOSS 2007 Forms Services then you probably also noticed that "Code Behind the Form" does not always run in the same smooth way it runs in the Smart Client (InfoPath 2007 Forms Preview). But what is really happening behind the scenes? Now, you can find out. You can read the following article over and over: http://msdn2.microsoft.com/en-us/library/aa944831(VS.80).aspx, but it doesn't really do the trick. After carefully following the output of attaching the debugger to the w3wp processes I noticed that it won't load your code-behind DLL, because it is "Optimized". Once you uncheck this debugging option you are in the debugging party. The complete recipe:

  • Start VSTOS 2005 and set the Debug Info to full in the advanced debugging Build options. Also uncheck the "Optimized" option. Publish your form. Inside the XSN file the manifest.xsf file will change and the PDB will also be part of the file now.
  • Upload the form to Central Administration and activate to the site if needed
  • Open the form in the site.
  • Start the regular VS 2005 and attach the debugger to all running w3wp processes. Load the source file that was used to build the code-behind DLL. Set breakpoints and notice they actually will break!

Have fun being twice as productive!

Posted on 20-06-2007 by Wim The
0 Comments  |  Trackback Url  |  Link to this post
Tags:

Links to this post

Comments

Name:
URL:
Email:
Comments:

CAPTCHA Image Validation