tag:blogger.com,1999:blog-2157078164517103759.post3342716812893465979..comments2023-07-31T03:31:57.774-07:00Comments on A Static State: Deploy InfoPath as a FeatureJason Apergishttp://www.blogger.com/profile/01817509015412502702noreply@blogger.comBlogger28125tag:blogger.com,1999:blog-2157078164517103759.post-15522260945619006282011-09-20T09:02:39.641-07:002011-09-20T09:02:39.641-07:00Muhammad - I developed this on SharePoint 2007 and...Muhammad - I developed this on SharePoint 2007 and have not rebuilt or tested on SharePoint 2010.<br /><br />JasonJason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-89071201652758090742011-09-20T07:51:44.199-07:002011-09-20T07:51:44.199-07:00I followed the same steps for SharePoint 2010, my ...I followed the same steps for SharePoint 2010, my form is visible in FormServerTemplates but is not visible as a content type in a form library settings. Does anyone know what might be the issue? ThanksMuhammad Farjadhttps://www.blogger.com/profile/02035960707067603786noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-33808020412254191762010-09-20T17:53:18.462-07:002010-09-20T17:53:18.462-07:00Jason,
Question 1 - section 4.5 of this post shou...Jason,<br /><br />Question 1 - section 4.5 of this post should address your question however there is no real straight forward solution.<br /><br />Question 2 - I can see how that can be a little tricky. I wish I could say I have an exact answer and I would think it is possible. However after reviewing what I wrote (which is about 2 years ago) it looks as if this may not be possible. This solution will generate a content type under the hood and you have no control over how the content type is generated. They may be a way but off hand I do not know it. Wish I could help on that.<br /><br />Thanks,<br />Jason<br /><br />Thanks,<br />JasonJason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-84292243606258596452010-09-20T05:54:02.753-07:002010-09-20T05:54:02.753-07:00Excellent post. 2 questions:
1. If you are deplo...Excellent post. 2 questions:<br /><br />1. If you are deploying as a feature using this method how can you promote properties to existing site columns?<br /><br />2. How can you deploy an InfoPath template and have it inherit from an exisiting content type that inherits from form. I'm starting to think this is not posssible.Unknownhttps://www.blogger.com/profile/16546303611815864915noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-7228050392102018302010-08-30T05:43:02.235-07:002010-08-30T05:43:02.235-07:00renewtx,
Yeah it is commonplace to make little er...renewtx,<br /><br />Yeah it is commonplace to make little errors like that which throw everything off.<br /><br />Sorry - I have to turn on moderation. I get spam postings and I do not want it to pollute my content.<br /><br />JasonJason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-73925024136638149372010-08-29T21:57:05.255-07:002010-08-29T21:57:05.255-07:00I was finally able to get this to work and generat...I was finally able to get this to work and generate what appeared to be a valid WSP file. This WSP file I was able to deploy to a clean system with no errors during deployment. However, one thing I overlooked in the batch file to deploy the feature was to actually activate it. So I attempted to manually activate the feature (which should be fine, right?). When I did so I got the following error -- any idea what's missing or going on here?<br /><br />Feature '25f5615f-b338-48ff-8eb7-2ba05dd9972c' could not be installed because the loading of event receiver assembly "Microsoft.Office.InfoPath.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=fe403af49d69c89f" failed: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.InfoPath.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=fe403af49d69c89f' or one of its dependencies. The system cannot find the file specified. <br />File name: 'Microsoft.Office.InfoPath.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=fe403af49d69c89f' <br /> at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) <br /> at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) <br /> at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) <br /> at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) <br /> at System.Reflection.Assembly.Load(String assemblyString) <br /> at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()renewtxhttps://www.blogger.com/profile/08834365124679788338noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-1399016317499223792010-08-29T14:52:19.788-07:002010-08-29T14:52:19.788-07:00Hi,
I'm trying to recreate your solution and ...Hi,<br /><br />I'm trying to recreate your solution and have a question -- how/where do I get the SolutionId used in manifest.xml? Is that just another std GUID I need to generate, or is it the SAME GUID as GUID I generate for the feature.xml??<br /><br />Thanksrenewtxhttps://www.blogger.com/profile/08834365124679788338noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-85195206224466976412009-12-24T08:36:57.735-08:002009-12-24T08:36:57.735-08:00Todd - thanks for contributing!Todd - thanks for contributing!Jason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-31712888033240367552009-12-24T07:41:36.930-08:002009-12-24T07:41:36.930-08:00I figured out my issue, so I am going to post the ...I figured out my issue, so I am going to post the answer here for the sake of posterity.<br /><br />If you deploy a form using the method described in this article, you have the choice of making the form "Workflow Enabled" or not. Adding the "GloballyAvailable" property (displayed below) will make the form workflow enabled. If you leave it out, the form will not be workflow enabled. You cannot add a browser-enabled form to a form library if it is workflow enabled. THAT was my problem.Toddhttps://www.blogger.com/profile/00882723743836405951noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-20499630080617521922009-12-21T18:00:54.452-08:002009-12-21T18:00:54.452-08:00The only bells I hear right now are Jingle Bells :...The only bells I hear right now are Jingle Bells :-)<br /><br />I wrote this bit ago so I do not recall everything. What I can say for sure is that a Feature should be visible in the site collection because the scope of the Feature is set to site. I cannot say if this is related to something you have done with workflow but I would not doubt it. This actually seems vaguely familiar, think you will get that error if you try to blow away a form that is associated to a OOB workflow.<br /><br />One thing you can do, if things are just getting a little harry, would be to just step back and create it from scratch, just a Hello World form that uses this blog. Then try to see where the differences are.Jason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-77380271387964396612009-12-21T13:59:52.050-08:002009-12-21T13:59:52.050-08:00Jason,
When you access "Site Settings -> ...Jason,<br /><br />When you access "Site Settings -> Site collection features" do you see your form template listed there? When I upload through Central Admin (and everything works), there is a feature listed here. When I deploy my form through a feature, it is not listed here. If I go to Central Admin's "Manage form templates" and try to activate to my site collection, I get an error:<br /><br />"This form template cannot be activated or deactivated. It is part of an installed workflow and cannot be accessed directly outside of the workflow."<br /><br />It appears that I am doing something to the form to tie it to a workflow.<br /><br />Does any of this ring any bells?Toddhttps://www.blogger.com/profile/00882723743836405951noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-73333615285438690902009-12-21T06:42:21.177-08:002009-12-21T06:42:21.177-08:00Todd,
I was just about to ask if you had tried to...Todd,<br /><br />I was just about to ask if you had tried to publish the form using the publish feature in InfoPath or if you had done it through Central Admin manually. I have not experienced the issue you are running into...<br /><br />JasonJason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-29208452438662275652009-12-21T06:17:09.763-08:002009-12-21T06:17:09.763-08:00This is a very nice post, and as a newbie to Share...This is a very nice post, and as a newbie to SharePoint development, I found it very useful. However, I am having one problem. My form is being added to Central Admin, and my content type is being created. I can then create a Form Library, and add the content type to the library. However, when I go to the library and click "New" (to fill out the form), it is trying to download the .xsn file instead of opening it in the browser. The form itself is configured to be opened in the browser, and I have configured the form library to open the form in the browser. In fact, if I manually upload the exact form using Central Admin, the form opens in the browser perfectly. The only obvious difference I see is that the manually uploaded form is not "Workflow enabled" while the form deployed using your method is.<br /><br />Any help?Toddhttps://www.blogger.com/profile/00882723743836405951noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-35247171883158160112009-10-19T17:40:06.840-07:002009-10-19T17:40:06.840-07:00Adolfo,
Easy is a relative term :-)
If you are n...Adolfo,<br /><br />Easy is a relative term :-)<br /><br />If you are not familiar with Visual Studio or .NET development I would not recommend this. This is a gradular way to deploy an InfoPath form for developers.<br /><br />I would recommend that you just use the Publish function directly in InfoPath.<br /><br />Thanks,<br />JasonJason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-78042975154302041112009-10-19T13:36:13.397-07:002009-10-19T13:36:13.397-07:00Hi Jason,
I am not a developer so I dont quite kn...Hi Jason,<br /><br />I am not a developer so I dont quite know how to deploy the solution (Even though you said it was easy). When I try to build the solution i get the following error.<br /><br />Program '\\WindowsApplication1\obj\Debug\WindowsApplication1.exe' does not contain a static 'Main' method suitable for an entry point K2Distillery.IP.NewUserForm<br /><br />Can someone please help?<br />ThanksAdolfohttps://www.blogger.com/profile/02748005362772219031noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-53257452474312826172009-10-19T13:11:40.836-07:002009-10-19T13:11:40.836-07:00Hi Jason,
I am not a developer so when you mentio...Hi Jason,<br /><br />I am not a developer so when you mention at the very end to build the solution in Visual Studio I get this error<br /><br />Program\\WindowsApplication1.exe' does not contain a static 'Main' method suitable for an entry point K2Distillery.IP.NewUserForm<br /><br />Can someone help me please?<br /><br />Thank youAdolfohttps://www.blogger.com/profile/02748005362772219031noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-63313295994045526152009-06-25T07:25:33.876-07:002009-06-25T07:25:33.876-07:00Hi,
would you please comment on how the versionin...Hi,<br /><br />would you please comment on how the versioning is made?<br />If you update the form and redeploy it, how do you assure that the old xmls can still be loaded.<br /><br />ThanksMario Kleine-Nathlandhttps://www.blogger.com/profile/13217260020428202141noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-6891691346082081502009-06-10T05:40:01.735-07:002009-06-10T05:40:01.735-07:00Roman,
I personally have not messed around too mu...Roman,<br /><br />I personally have not messed around too much with MOSS Content Deployments; I have heard they are some challenges with it.<br /><br />I know person or two who may be able to provide you some assistance. I will forward this along...<br /><br />JasonJason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-21308002652941428942009-06-10T01:15:55.739-07:002009-06-10T01:15:55.739-07:00Interesting, indeed.
However my biggest concern a...Interesting, indeed.<br /><br />However my biggest concern about infopath forms deployment is the moss content deployment.<br /><br />It simply doesn't work. It doesn't even matter if the form contains managed code (full trust) or not... Once I have it deployed to a library (limited trust) or manually via forms management (full trust scenario) to the "content source" moss the incremental content deployment job to our live environment breaks.<br /><br />Typically we have to deploy forms to both environments to not break content deployment. A requirement for content deployment is feature consistency after all:-/<br /><br />There might be improvments in SP2 - but we aren't using it yet :-/<br /><br />Creating a feature out of a form doesn't really help here I guess. It's a pity.Unknownhttps://www.blogger.com/profile/10774782646765249532noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-42298580323958442432009-03-30T11:00:00.000-07:002009-03-30T11:00:00.000-07:00Glad to see you figured it out.Glad to see you figured it out.Jason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-77403125225882893422009-03-30T06:12:00.000-07:002009-03-30T06:12:00.000-07:00I think i was having problems because my developme...I think i was having problems because my development system was "dirty" and I had a misunderstanding of what site features in the onet.xml of a site definition would get activated. I had thought that when I created a site with a site defintion, site features would get activated. However, this is not true if you are creating a sub-site, hence, my infopath forms (site features) were not being activated when I thought they were being activated. Once I understood this, I simply added activated the infopath form features using stsadm commands after deploying the solution and presto, the content-types were created as you described.Anonymoushttps://www.blogger.com/profile/05881750134261043581noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-77635730423741870702009-03-26T13:20:00.000-07:002009-03-26T13:20:00.000-07:00i followed your example and added an infopath form...i followed your example and added an infopath form feature to a site definition, and included the feature in the SiteFeatures node of the configuration. When I deploy the solution, the infopath form feature gets added to the site collection features and is activated. I can see the form in the site/formservertemplates, but the form is not listed as a contenttype.Anonymoushttps://www.blogger.com/profile/05881750134261043581noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-65334299380961623812009-03-12T21:34:00.000-07:002009-03-12T21:34:00.000-07:00Allen - when you say "my webpart" are you referrin...Allen - when you say "my webpart" are you referring to a custom webpart that you have written?<BR/><BR/>JasonJason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-11208506545732418052009-03-12T20:04:00.000-07:002009-03-12T20:04:00.000-07:00i for some reason cannot get this to work.the only...i for some reason cannot get this to work.<BR/><BR/>the only difference between the post and my example is that i have the infopath forms in a seperate folder, but the feature deployment works and i've verified that the feature is active on the site whose template references the feature.<BR/><BR/><BR/>i've at a loss here, because everything works at runtime until the infopath form is attempted to be referenced from my webpart and the XmlFormView instance attempts to use the XmlForm member and it is null causing the following error:<BR/><BR/>Object reference not set to an instance of an object.<BR/><BR/>Web Parts Maintenance Page: If you have permission, you can use this page to temporarily close Web Parts or remove personal settings. For more information, contact your site administrator. <BR/><BR/><BR/><BR/>if i manually add the forms via the admin portal, this works as expected?????Unknownhttps://www.blogger.com/profile/00964579961896561882noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-2082814601565684992009-01-14T03:56:00.000-08:002009-01-14T03:56:00.000-08:00dchillman,I will have to work up something. I hav...dchillman,<BR/><BR/>I will have to work up something. I have few things in my queue...<BR/><BR/>In the meantime look in to feature activation event receivers and basically you will have to open a connection ot the web, find the content type, then create a form library instance on a site, and finally associated the content type to it...Jason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.com