Debug in Interpreted Mode Your X++ Code that Runs as .NET CIL

Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

In some cases you can debug your X++ code in interpreted mode even where the code is typically compiled to run as .NET Framework CIL. To activate this option, you clear a check box in the Options window of the Microsoft Dynamics AX development workspace.

During development when you are frequently making code changes and retesting, it is sometimes more convenient to debug X++ in interpreted mode. This option is convenient in the following ways:

  • You can avoid regenerating the CIL after each X++ code change.

  • You can debug by using the Microsoft Dynamics AX debugger, instead of attaching the Microsoft Visual Studio debugger to the Application Object Server (AOS). This is important when multiple developers are sharing one AOS.

Configuration Check Box

The option to debug X++ in interpreted mode is found here in the development workspace:

Tools > Options > Development > General > Execute business operations in CIL

Initially the check box is selected. You clear the check box to debug in interpreted mode.

Applicable Scenarios

In some cases you can debug your X++ code in interpreted mode even where the code is typically compiled to run as .NET Framework CIL. But in other cases you cannot, and you can only debug in CIL mode. The following table lists some cases in each category.

Option available?

Cases

Yes, the Execute business operations in CIL setting has an effect. You can debug X++ code in interpreted mode.

  • Your code runs under the Business Operations Framework (BOF).

  • Your code is invoked by a utility method that runs your code as CIL, such as:

    • SysDictClass::invokeStaticMethodIL

    • SysDictTable::invokeStaticMethodIL

    • Global::runClassMethodIL

    • Global::runTableMethodIL

No, the Execute business operations in CIL setting is ignored. You must debug in CIL mode.

  • Your code is run on the AOS by a batch job.

  • Your code is run by the runAs function of the X++ language.

  • Your code is run on the client.

See also

Microsoft Dynamics AX IDE

Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.