Home > InfoPath2010, SharePoint 2010 > Deploy InfoPath form as SharePoint feature in SharePoint2010

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:

  1. Change the form Security Level to Domain

  2. Publish the InfoPath form to a network location

  3. Create an Empty SharePoint project as follows(one element and one feature)

  4. Change the Deployment Location Path of Elements.xml file to root (i.e. empty location) as highlighted below

  5. 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

  6. Add the feature receiver Assembly Microsoft.Office.InfoPath.Server, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c

    and add the feature receiver Class Microsoft.Office.InfoPath.Server.Administration.XsnFeatureReceiver to the feature properties as highlighted below.

  7. (**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
  8. 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.
  1. January 11, 2012 at 10:33 am

    Bravo. Seems to work for me. Bizarre why it needs feature receiver code to actually work

  2. August 16, 2012 at 9:57 pm

    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.

  3. shannon
    December 13, 2012 at 4:49 pm

    It works great but I’m tring to add code behind to the deployment package and the form will not open

  4. Mortimer
    October 11, 2013 at 3:39 am

    Works great, thank you!

    Please note that in elements.xml, the url and name attributes values must be equal. If you change the url, then change the value for the name attribute accordingly. Didn’t work for me if the values are different.

  1. February 5, 2012 at 10:45 pm
  2. October 18, 2012 at 1:32 am
  3. November 23, 2013 at 3:23 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: