Deploy InfoPath form as SharePoint feature in SharePoint2010
You can publish your InfoPath form directly to SharePoint2010 using InfoPath2010 publishing feature. However, some of the clients require that all SharePoint deployment has to be done using SharePoint features and solutions. Next, I will show you how to do this:
-
Change the form Security Level to Domain
-
Publish the InfoPath form to a network location
-
Create an Empty SharePoint project as follows(one element and one feature)
-
Change the Deployment Location Path of Elements.xml file to root (i.e. empty location) as highlighted below
-
Change the Deployment Location Path of ContactUS.xsn file to root (i.e. empty location) and change Deployment Type from NoDeployment to ElementFile as highlighted below
-
Add the feature receiver Assembly Microsoft.Office.InfoPath.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c
and add the feature receiver Class Microsoft.Office.InfoPath.Server.Administration.XsnFeatureReceiver to the feature properties as highlighted below.
- (**Update**)
Navigate to the current feature >> Manifest then add the following properties as below(this is not used in this project , but used in deploying Workflow initiation form or association form
- Deploy the solution to a SharePoint site , you will find the InfoPath form under the InfoPath contentType. You can download the sample code here, however you need to open the ContactUsFormUnpublished.xsn using InfoPath Designer and republish the form(Make sure you publish your form to a network location otherwise you might get the The XSN cannot be used on the server.) and replace the current published form in the project with the new one.
Categories: InfoPath2010, SharePoint 2010
InfoPath2010, SharePoint2010










Bravo. Seems to work for me. Bizarre why it needs feature receiver code to actually work
Hi, When i tries to run your project and give path for publish form on a SP site then after debug it opens the SP site only and the form is not published on that SP site.
It works great but I’m tring to add code behind to the deployment package and the form will not open