AX2012 Debug AX batch job or web service from Visual Studio
1. Go to AOS server you want to debug
2. Change AX client configuration to environment you want to debug
3. Open visual studio as administrator
4. Debug --> Attach to Process (show process from all users must be selected unless you're using AX service account)
5. If there are multiple AOS instances in the same server, use "Task Manager" to check the PID of environment you want to debug
6. Right click --> Go to service(s)
The PID of AOS could be obtained, choose the right one based on environment we had set in Step 1.
7. Back to "Attach to Process", choose right PID, click "Attach".
8. Open AOT in Visual Studio, choose method of related class you want to debug and put breakpoints there
9. Sometimes when debugging, it will ask for path for the CIL code/ reference, just choose XppIL folder of AOS.
e.g C:\Program Files\Microsoft Dynamics AX\60\Server\UAT\XppIL