Breakpoints

All the batch jobs and service operations now run in the managed code (IL) and therefore breakpoints set in x++ do not get hit as expected! Instead you should be setting breakpoints in the IL code in Visual Studio. Here are the steps you would be following to do so:

2. Go to Debug > Attach to Process. Click “Select…” and check the appropriate version of the managed code in your case.

3. Check both options at the bottom of “Attach to Process” form. Select Ax32Serv.exe from the list of processes.

4. Load the XppIL source file in Visual Studio now. Make sure you have enabled breakpoints to debug x++ code in the AX Server Configuration Utility. You can find these files under a location similar to the following:

6. Finally, trigger the batch job or service operation to debug in the AX Client. The breakpoint set in Visual Studio should be hitting now! Make sure to generate IL to reflect the changes in the XppIL source files after updating the x++ code.

If you are not hitting the breakpoints you set in X++ code as expected then make sure that your code isn’t executed by the SysOperation Framework (formerly known as Business Operations Framework – BOF). If this is the case then you can force the AOS to debug your code in Dynamics AX Debugger by CLEARING the following check in Dynamics AX Development Workspace:

Tools >> Options >> Development >> Execute Business Operations in CIL

Moreover, make sure that Debug mode is set to:

When Breakpoint

Actually AX 2012 executes business logic as compiled .NET CIL to run faster. You can also debug your X++ code in Visual Studio Debugger by opening your method’s xpp file in Visual Studio then attaching to Ax32.exe process (Tools >> Attach to Process). In this way you will be debugging your X++ code in compiled .NET CIL mode. You can find your method’s xpp file under the following location: