How to Debug batch jobs and service operations in Dynamics AX 2012
Views (12940)
All batch jobs and service operations now run in managed code (IL) and require different debugging steps. Rather than setting breakpoints within X++, you need to set them within the IL code that corresponds to the X++ code and debug in Visual Studio.
- Open Visual Studio as 'administrator' and attach the debugger to the Ax32Serv.exe process.
- Note that it may also be necessary to change the ‘Attach to’ selection to ‘Managed (v4.0) code’ and make sure “just my code” is unchecked in VS: tools->options->debugging->General
- Once done, open up the file you want to debug in Visual Studio. All of the X++ code is compiled into IL and can be found in the following directory after deployment: ..\Program Files\Microsoft Dynamics Ax\6.0\Server\AxaptaDev\Bin\XppIL\source\
- Set a breakpoint in the file you opened.
- Go to Ax and run the process in batch mode, or execute the service operation. This will end up hitting your breakpoint, provided you set it in the right place.
This was originally posted here.
*This post is locked for comments