Building a WSP with Infopath Forms

Published 05 October 07 11:26 AM | Tom Wardill

A WSP is the preferred deployment solution for anything to do with sharepoint, such as web parts and workflows. While the workflow solution in Visual Studio should auto-generate a lot of the manifest.xml file that is used, there are a couple of little things that need to be altered before it will behave as expected.

  1. Build the solution in Release mode before attempting to alter any of the files that have been provided, the auto-generation tool doesn't run until the first build.
  2. Check that the manifest.xml is deploying the main workflow dll to the GAC. The correct setting in the 'Assembly' line is 'DeploymentTarget="GlobalAssemblyCache"'.
  3. Alter the wsp_structure.ddf to include the Infopath forms that are used within the workflow. The solution should have created the basic structure, then all that should be necessary is to add the form location and form name for every form that you are using, following the sample that has been provided.
  4. If you have any Infopath forms with Code Behind, it is necessary to manually add the dll to the manifest.xml so that they get deployed to the feature directory along with everything else that is required.
    1. Use the 'Resources' tag in the manifest.xml
    2. Give the location and name of the dll ( "ProjectName\DllName.dll" )
  5. Build, Deploy and Test
    1. Build
    2. stsadm -o addsolution -filename <filename>.wsp
    3. stsadm -o deploysolution -name <filename>.wsp -local -allowgacedeployment (might also require -url <site to deploy to>
    4. install and activate as required.
Filed under: ,

Comments

# Martin said on December 18, 2007 07:02 PM:

Hello Tom,

I'm trying to deploy a workflow to a live server in a wsp file.

My workflow works on the development server.

Once deployed, the task forms apparently can't be found (they don't have any code behind - they just use rules)

The wsp file is structured like this...

The assembly and manifest.xml are in the root

It has the forms (all task) feature.xml and workflow.xml in a sub directory that is the name of the feature.

The feature directory under the 12 hive initially contained just the feature.xml and the workflow.xml

I manually extracted the xsn files from the wsp and put them in the feature dir as well.

Still when I click on a task created by the workflow, Forms Services gives me the message  "The form has been closed".

In the sharepoint log, I get a message from Forms Server saying the specified form cannot be found.

The feature.xml has a property setting like this

<Property Key="RegisterForms" Value="*.xsn" />

Just to reiterate - this works on my development server.

Any suggestions much appreciated.

Thanks

Maritn

# Martin said on December 18, 2007 07:19 PM:

The xsn files were missing from the feature directory.

Entries like

   <ElementFile Location="Form1.xsn"/>

     <ElementFile Location="Form2.xsn"/>

in <ElementManifests> of feature.xml fixed it.

Martin

Leave a Comment

(required) 
(required) 
(optional)
(required)