Remote Debugging a Full Trust InfoPath Form in SharePoint
Posted
Tuesday, January 13, 2009 3:07 PM
by
CoreyRoth
A while back, I posted about how to Remote Debug a task form for a workflow. The post I made didn't clearly specify I was talking about a task form so I went back and updated it. This made me thing that I haven't covered how to debug a Full Trust form outside of a workflow. Although the process is similar, I thought I would take the time today to discuss how it is works.
As you probably know, full trust forms that you deploy for use in form libraries must be uploaded via the Manage Form Templates page in Central Administration. With a workflow, you would copy your DLL and PDB file for the form into the feature folder of the workflow. Since a workflow is not involved in this case, the form obvious goes somewhere else. If you examine your FEATURES folder in the 12 hive you will notice that you may have some folders starting with FT-01 followed by a guid (for example FT-01-3b866d3d-cc74-ec32-8fc2-e52f0839dd4f). These are folders created when you upload a form template.
When you open the folder, you will see that it will contain multiple subfolders starting with solution.xsn followed by a version number. It creates a new folder for every version of the form you upload. Find the latest version number and open that folder. In each folder you will see an XSN, DLL, and PDB file. The template manager is nice enough to copy the PDB file for you (assuming you compiled it in debug mode). Now you need to make sure that the DLL versions are the same between your compiled bin folder on your local machine and this folder. More than likely they have different version, so you need to copy files from one folder to another (shouldn't matter which direction). It seems like the versions should be the same but they never are.
At this point you can remote debug as usual. Open up the Visual Studio Remote Debugging Monitor on the remote machine, determine the correct w3wp process, and set a breakpoint. If you need more details see my other post on remote debugging InfoPath.