TFS Source Control in InfoPath 2010

The purpose of this article is to explain how InfoPath 2010 integrates with Team Foundation Server to provide source control for the forms.

  

  • Since the XSN file generated by InfoPath is a binary file and since Team Foundation Server cannot do this source control on binary files, the first step would be export the source files from InfoPath.

To achieve this, in the XSN file, click on File –> Publish and then Select the ‘Export Source Files’ Option and export the source files to any folder.

image

  • Now all the source files are saved to the specified location.

image

  • To start collaborating on the InfoPath form, all the developers need to open the form using the manifest.xsf file instead of the XSN file directly.
  • After opening the InfoPath form using the manifest.xsf, update the location of the form code project location by clicking on Developer –> Language.

image

  • Now, you are all set! Check-in the entire folder into TFS. Since this folder also contains dlls, pdb files ensure that you include these files explicitly, since TFS ignores these by default.
  • When developers make changes to the InfoPath form, the changes update the corresponding source files i.e., the XSL, XSD and other files accordingly depending on the changes.
  • When two developers are working on the form, they can merge changes on these source files if there are conflicts.
  • Once the development is complete, open the XSF file and then you can publish the InfoPath form to the SharePoint Server directly (or) save the XSN to any location if the form is an administrator approved form template.

image

Some of the Best Practices that need to be followed to ensure that all the developers can effectively work simultaneously on the same InfoPath Form:

  • Since InfoPath stores the physical location of the Solution containing the code, it is recommended that all the developers map the root folder containing the source files and the form code to the same location in their local machine.
  • Before making any changes to the InfoPath form, remove the read only property on all the Source Files and Source Code.
  • For checking in the changes, perform a checkout on the folder in TFS and then check in immediately.

Highly recommend you to watch this video on channel 9 - https://channel9.msdn.com/Blogs/laurhar/Programming-with-InfoPath-2010-Source-Control&ei=1We0T-D_Ms7trQfUuuWDDA&usg=AFQjCNFzR2cvQ56i4_mFBOWBD04jDPB9Xg

and read this blog post by InfoPath team: https://blogs.msdn.com/b/infopath/archive/2010/06/10/using-tfs-for-source-control-in-infopath-2010.aspx