With a tight integration between X++ and Visual Studio, an integrated debugging
experience is essential for developers. It is possible to use the Visual Studio
debugger to debug managed code that is called from X++. The opposite is also
true. X++ code that is called from managed code can be debugged using the
Microsoft Dynamics AX debugger.
Debugging Managed Code Called from X++
Perform the following procedure to debug managed code called from X++ code.
The procedure continues with the example of the MyPreEventHandler managed
code, on the SalesFormLetter.run() event:
1. Create a job in Microsoft Dynamics AX that executesSalesFormLetter.run().
2. In Visual Studio, put a breakpoint on a line of code within thepreRun method of the MyPreEventHandler class.
3. Select Debug and then Attach to Process.
4. From the Available Processes field, select the Microsoft Dynamics
AX client process (Ax32.exe) and click Attach. The client process is
selected since the code being debugged runs on the client.
5. In Microsoft Dynamics AX, run the job.
6. The Visual Studio debugger will appear, waiting at the breakpoint.
Debugging X++ Called from Managed Code
Perform the following procedure to debug X++ code called from managed code.
1. Create managed code in Visual Studio that calls a method on a
Microsoft Dynamics AX proxy (table or class).
2. On the Visual Studio project's properties, set Debug Target toClient and Startup Element to the AOT element that contains the
X++ code you wish to debug. The format of this property should be
"AOT Node\Element Name". For example, Classes\SalesLineType.
Acceptable element types are job, menu item, class and form.
3. In that startup element in Microsoft Dynamics AX, place a
breakpoint in the X++ code you wish to debug.
4. Press F5 in Visual Studio to debug the managed code.
5. When code execution reaches a breakpoint in X++ code, context will
switch to the Microsoft Dynamics AX debugger.
Best Regards,
Hossein Karimi
Saturday, July 14, 2018
Visual Studio Debugging Experience for X++
Labels:
AOT,
Visual Studio,
X++
+10 years of experience with hands-on lead-level background in the full life cycle of software development with demonstrated cross-functional team leadership skills.
Programming:
• ERP :Microsoft Dynamics AX 2012
• Language :X++, C#, C++, XAML, Asp.Net, Html, VB.Net, Android
• Environment : Windows XP, Windows 8, Windows 10, Windows Server
• DataBase : Oracle 9i,10g,11g and SqlServer and SQLlite
Subscribe to:
Post Comments (Atom)
Configure the Firewall on the Enterprise Portal Server
After you install Enterprise Portal, enable Web Server (HTTP) in Windows Firewall. If you do not enable the web server in Windows Firewall...
-
To integrate Microsoft Dynamics AX and Analysis Services, you must connect Analysis Services to the Application Object Server (AOS). To do s...
-
The below select query will give the both the Sales Line record count and the sum of sales quantity. static void Test_Data(Args _args) ...
-
In Reporting Services, reports and resources are processed under the security identity of the user who is running the report. If the report ...
No comments:
Post a Comment