When working with InfoPath forms which have managed code, we need to deploy as an administrator-approved form rather than publish directly to a list or content type. The process is:
- publish the form to the filesystem
- upload the form via ‘Manage form templates’ in Central Admin
In the background, the last step actually wraps the form .xsn and associated assembly in a Solution and Feature, and deploys throughout your farm. Understandably this is S-L-O-W for development, so I started looking at ways to speed this up. Interestingly the assembly doesn’t get deployed to the GAC or web application bin directory, but resides solely in the folder for the Feature (click image to enlarge):
Nevertheless, instead of publishing the form we can do the following:
- compile VSTA/VSTO project
- copy .dll (and .pdb if we’re in debug mode) over the ones in the Feature folder
- recycle app pool
This will then load the updated code. Note because we’ve only deployed the updated code to the local machine, only form sessions on the local machine will be affected (I’m assuming you’re not using a load-balanced URL in dev) – this has a nice side-effect of isolating your changes from other developers in the farm until you’re ready to release them.
I’m interested to know how InfoPath accomplishes the trick of loading assemblies from this location at run-time -there are no custom ‘probing’ entries in my web.config (instructions to tell .Net to probe custom locations for assemblies) so I’m assuming it’s done via reflection.
If you have your own tips for speeding up SharePoint development which aren’t commonly-known, I’d be interested to hear…