AX 2012: How to debug batch jobs and service operations?

Posted on Updated on

Untitled

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:

1. Open Visual Studio as an Administrator and go to Tools > Options > Debugging > General. Make sure “Enable Just My Code (Managed Only)” is unchecked.

Image

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

Image

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

Image

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:

C:\Program Files\Microsoft Dynamics AX\6.3\Server\AxaptaDev\bin\XppIL\source

5. Now set the breakpoint at any of the desired statement.

Image

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.

Advertisements

2 thoughts on “AX 2012: How to debug batch jobs and service operations?

    Debug a batch task AX 2012 | Anil Kumar's Blog said:
    March 17, 2014 at 1:36 pm

    […] More Info – https://dynamicsaxinsight.wordpress.com/2014/03/10/ax-2012-how-to-debug-batch-jobs-and-service-oper… […]

    Syed Shujaat Ali Bukhari, Technical Consultant at Itineris said:
    October 20, 2016 at 4:39 am

    Thanks for this post. Really helpful.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s