A lightweight approach to retrieving the solutionVersion attribute from the xsn? - InfoPath Dev
in

InfoPath Dev

A lightweight approach to retrieving the solutionVersion attribute from the xsn?

Last post 12-08-2008 07:13 PM by Jimmy. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-08-2008 06:26 PM

    A lightweight approach to retrieving the solutionVersion attribute from the xsn?

    Hi, guys

     I'd like to make my InfoPath based .NET solutions (not necessarily using the InfoPath or other Office applications) more stable and scalable and get the most out of the schemas and so on. Sometimes I need to generate the xml files and store them in the Forms Libraries and the like and make sure that the current version of the template is used when opening those in InfoPath or via browser.

     Certainly, we can create the Microsoft.Office.Interop.InfoPath.Application object, get the msoInfoPathApp.XDocuments (XDocumentsCollection) property thereof, execute xDocs.NewFromSolution("...",1) to get a new xml form and use its newForm.Solution.Version property. But this approach requires the client application to be available and is not suitable for server environments. Not to mention the amount of resources used every time.

    Can anyone suggest a more lightweight approach to the problem? At least a shortcut to the appropriate namespaces and classes (to deal with CAB from .NET) would be appreciated.

    Thanks in advance

  • 12-08-2008 06:46 PM In reply to

    Re: A lightweight approach to retrieving the solutionVersion attribute from the xsn?

    I don't understand your situation entirely, as in how exactly you are using these InfoPath files, but I will answer it as well as I can.

    The .NET foundation classes, to the best of my knowledge, do not provide any good functionality for CAB extraction and that requires an external library.  One such library is CABLIB, which is free to use and licensed under the Code Project Open License.

     If you have access to the .XSN template from whatever server code you're writing, you can use this library to extract the file, look at the manifest.xsf file inside, and determine the solution version.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-08-2008 07:07 PM In reply to

    Re: A lightweight approach to retrieving the solutionVersion attribute from the xsn?

    Jimmy, thanks. Myself as soon as I quit trying to find an InfoPath-specific solution, I turned to this very CabLib which, according to the description, is quite impressive. I'll post a snippet of the eventual solution unless I forget to.

  • 12-08-2008 07:13 PM In reply to

    Re: A lightweight approach to retrieving the solutionVersion attribute from the xsn?

    Cool.  We use CabLib in our solutions here at Qdabra, and while it has a few flaws and its error messages aren't great, it tends to get the job done.

    Best of luck.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.