简体   繁体   中英

How can I generate CIL from X++ in Dynamics AX 2012?

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!

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

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();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM