We are currently using AX 2012 CU-2. We came across an issue whereby generating CIL in a specific scenario caused some errors to be generated which did not help us to understand the cause of the issue.
In AX 2012 client, under menu File\Tools\Options, click on Development on left hand side and than the Compiler tab. In here you can change the default compiler output from “Form” to “Message Window”. This setting does not only effect the AX X++ compiler but also the output of the CIL compiler/generator as I found today.
When generating (incremental) CIL it’s required the X++ code compilation has first finished compiling without errors. However if you sometimes start CIL generation on a system where there still exits X++ compilation errors and with the compiler output setting set to “Message Window” than you get an error which may be confusing (see screenshot below) .
In the code snipett screenshot (given write at the bottom) where I added an X++ error to the class you can see by the icon in the AOT in front of the changed method there’s an error (top most dot is read; Green bottom dot means compiled without errors)
When now generating Incremental CIL I get the error below in the info log window. (No Messages get logged to the compiler output window)
Furthermore, generating CIL hereafter will hang the AOS (even if you have switched back the compiler output setting to “Form”) until the AOS service has been restarted.
We worked around by keeping the Compiler output settings to its default setting “Form”. With this setting generating CIL will report the X++ errors in the output dialog at the bottom of the screen, and the info log provides a meaningful error (See print screen below) and you can repeat generating CIL without AOS restart.
We're always looking for feedback and would like to hear from you. Please head to the Dynamics 365 Community to start a discussion, ask questions, and tell us what you think!