1

I am having trouble finding clear instructions on how to deploy an InfoPath form using only Visual Studio. It is my understanding that there are multiple ways to deploy a form with the two most popular being (1) into a Forms Library with the form stored in the library or (2) as a Content Type with the form being stored in a "central" library.

All of the blog postings I have read that claim (via blog title or content) that the article is about deploying via Visual Studio yet the first step on almost all of them is to deploy the form using InfoPath Designer. Huh?

They also tend to mention creating Event Receivers but I do not understand what that step is for...

Can somebody please explain this or point me in the proper direction? What am I missing?

Thank you

1

If you notice, the blog postings require you to "Publish" the InfoPath form to a local path so you can include it in your Visual Studio feature. Publish is a little misleading. It basically is a "build". You have to build the InfoPath artifact (the xsn) and have it ready to go. You then use Visual Studio to create a feature which does all of the heavy lifting of placing the elements into their proper places in SharePoint, registering everything...all the SharePoint black magic.

The very first blog post you listed above looks pretty good. Did you try working through it? I am going to try that myself as I am looking to achieve the same thing you are.

-Edit- After trying to work through the first example from your links I ran into a few places where the instructions for the older version of Visual Studio diverge pretty significantly from VS 2013 and the MSDN reference page on the XsnFeatureReceiver. The more I considered what I wanted a feature to do - deploy a form to Central Admin as a content type that site collections could reference - the more I realized that a feature didn't really do anything of significant value.

Think about it: You do all design changes and modifications to data connections within InfoPath. At that point, you upload the form and the udcx files to SharePoint Central Administration which creates a feature instantly available to all Site Collections. You activate the feature in a SC and now you have a content type. You add the content type to a list. If you have to modify the form, you do it in InfoPath and simply re-upload the form to Central Admin. A Visual Studio feature only complicates the process. I'm abandoning any thought of making a Visual Studio solution for this reason. It offers no value.

0

I am adding this as a second answer. I stumbled onto a blog post where the guy totally nails down how to add InfoPath via a feature. Not only that, he shows how to use code-behind with a browser-enabled form. I know that sounds like poppycock but he actually does.

Anyway, this post is so good that I could almost see changing my opinion from above about deploying InfoPath forms to SP. Almost ;)

http://www.stuartroberts.net/index.php/2013/03/13/register-code-behind-infopath-form-for-web-browsing/

Hope that helps you.

(Note that there is way too much information on the referenced post for me to put it here within StackExchange so you post-Nazis go ahead and flame me all you want. I don't care. In fact, the information on people's blog posts are actually the property of the blog owners so no one on forums like this should be copying and pasting information anyway. EVER! But I digress.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.