Sunday 6 November 2016

How to debug AIF AX2012

In this post I will demonstrate the debugging of AX2012 AIF services, which makes the lives of developers easy :).

We can simply debug the AIF service, triggered from C# code which was written to consume the AIF services.

I have created a document service and written some custom code in service classes. Now I want to debug and see the impact.

Follow below steps:

Prerequisite: Your environment should be full CIL compiled.

Step 1: Create a console application in visual studio C#, to consume the AIF service. This was demonstrated in my earlier post. For more details visit below link.


Step 2: Open a new visual studio application. Right click visual studio and Run as admin.

Step 3: Open Application explorer in visual studio and find your service class.




Step 4: Now go to Debug option and attach the process to server.
 Step 5: Make sure that the symbol loading is completed and the debugger symbol is completely turned Red.


Step 5: Now the service is ready to be debugged. Switch to the first visual studio application where you have written the C# code as per the Step 1. Make sure the two VS applications are running simultaneously.

Step 6:  Run the test code, the debugger will hit the line of code on another VS application where you have attached the server processes.


Note: Debugging is possible in VS only, this will not open AX debugger, also the client side code will not be executed in debugger.

Happy daxing :)


No comments:

Post a Comment