Automated Importing of XPO

Hi All,

I need some assistance importing XPO via power shell or by writing a shell script or some windows Job (Please not I only want to automate this for importing the XPO and not for importing model or mode store)

Every time when I’m done with developing my requirement in DEV environment, I manually export an XPO to a particular location.

I would like to know if importing XPO from this location can be automated or not? I would like to do the following during the automated process.

When I run a shell script following should happen.

  1. it should ask me to browse and select the .xpo file
  2. Aftre selecting the XPO files (press enter key or by some user action) the process should start importing
    the XPO (Assume that there are no conflicts and no manual compare is needed)
  3. After importing the XPO it should provide options to generate full CIL or incremental CIL following Data
    dictionary synchronization
  4. In the end a log file with errors captured during import (if any) or a successful import message.

I think this is a familiar process, I’m very curious if anyone has built such a script already or tried something similar?

Any info or if anyone help me to have such a script would be highly appreciated.

many thanks in advance.

You really should start using a version control system instead of bothering with .xpo files manually. I find it a bit shocking that there still developers who are willing to work without version control… It’s so dangerous and inefficient.

When you have version control, you can use a build system (such as Team Foundation Build) to prepare an application from the given version of source code.

To answer your question, you can use startup commands to import .xpo files from a script. See MSDN: How to: Import a Class on Startup for an example.

By the way, your steps miss X++ compilation before generating CIL.

Hi Martin,

We are using version control I’m already aware of this process of build and release via TFS, and I’m aware of consequences of pushing an XPO like this.

The question which I asked is generic, and I was looking/Searching if there was such a tool already available. The link you gave is helpful.

This explains how to import an XPO via command, however is it also possible to perform the tasks like compile the objects imported, generate CIL etc via command line?

Yes, it is possible. To avoid reinventing the wheel, look at my Powershell module and Joris’s libraries for this kind of tasks.

Thank you!!