3

Is it possible to generate CIL (either incremental or full) from within X++ code or the command line?

My problem is that I want to import a model or xpo into AX, and I need the CIL to be generated automatically. This is for automated testing we are doing-- so, I can't use the UI like you normally would to generate the incremental or full CIL

Thanks!

j.a.estevan
  • 3,057
  • 18
  • 32
Maxthecat
  • 1,250
  • 17
  • 37

2 Answers2

7

Passing the startupcmd parameter to the AX client causes it to run the corresponding SysStartupCmd class. There's one called SysStartupCmdCompileIL that does a CIL compile.

"C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe" \\server\share\yourconfigfile.axc -startupcmd=CompileIL
Jay Hofacker
  • 3,439
  • 20
  • 14
2

The code the command line calls, from Jay's post, if you want it in X++ is as follows:

try
{
    SysCompileIL::generateIL(); 
}
catch
{
    SysCompileIL::mergeAssemblyFile();
    throw Exception::Error;
}
SysCompileIL::mergeAssemblyFile();
Alex Kwitny
  • 11,211
  • 2
  • 49
  • 71