Building XSN file from source files using MSBuild

C

Clayton

Has anybody built their infopath form in an MSBuild script that will compile
my source files and package it into an XSN? Im trying to automate my build
process for Cruise Control.NET
 
C

Clayton

For anybody who wants to do this...

I first create an msbuild target that simply builds the solution, and then I
call a custom console app I wrote that simply searches the manifest.xsf
(using XPath) to find all the files that belong in the XSN document, and
then put them together using the CABSDK. A gotcha I found is that after the
MSBuild of the project, I had to XCopy the contents of the template source
file into another directory (my Post Build event in visual studio) because I
wasnt able to access them directly from my console app (said the files were
already in use).


<PropertyGroup>
<SolutionFile>SharepointForms\SharepointForms.sln</SolutionFile>
</PropertyGroup>

<Target Name="Build"
DependsOnTargets="CompileInfoPathSolution;BuildInfoPathXSN" />

<Target Name="CompileInfoPathSolution">
<Message Text="Building solution" />
<MSBuild Projects="$(SolutionFile)" />
</Target>


<Target Name="BuildInfoPathXSN">
<Message Text="Packaging the InfoPath source files up into the XSN
file." />
<Exec
command="..\Utilities\InfoPathTemplateConverter\build\InfoPathSourcePackager
$(PermitApplicationSourceFiles) $(PermitApplicationXSNFileOutput)" />
</Target>


See the "CreateFileFromXSN" portion of this document...
http://msdn2.microsoft.com/en-us/library/bb608315(office.11).aspx I rewrote
that javascript in C# inside of a console application and it works great.

Good luck.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top