How to: Debug X++ Code Running in .NET Business Connector [AX 2012]
This topic has not yet been rated - Rate this topic
Updated: December 16, 2011
Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
The Microsoft Dynamics AX development environment enables you to create a .NET-connected application and integrate with Microsoft Dynamics AX. By using .NET Business Connector, you can call X++ methods and access data from a .NET-connected application.
Microsoft Dynamics AX requires that you set breakpoints through the client and the debugger. You need to enable setting break points in the client configuration, and then enable debugging in the .NET Business Connector configuration. For more information about debugger, see Microsoft Dynamics AX Debugger.
There are two modes to debug .NET Business Connector code; interactive and non-interactive. An example of using the interactive mode is integrating Microsoft Excel with Microsoft Dynamics AX. For more information, see How to: Enable the Debugger. An example of using the non-interactive mode is integrating with Enterprise Portal. The following steps provide information to debug X++ code from the .NET-connected application using the non-interactive mode.
Prerequisites
To complete following procedures, you will need:
Microsoft Dynamics AX installed with a developer license file
Client, server and .NET Business Connector on the same computer
The Microsoft Dynamics AX developer is in the Windows admin group
Procedures
Setting the Configuration Settings to Enable Debug
In this section, you will set the configuration settings to enable your X++ code to be debugged from a .NET-connected application. The settings are in the Microsoft Dynamics AX Configuration and Server Configuration windows.
To set the configuration settings
From the Start menu, point to Administrative Tools and then click Microsoft Dynamics AX Configuration.
Click the Manage button and then click Create configuration.
Give the Configuration a name like DebugClientOption and click OK.
Click the Developer tab, select Enable user breakpoints to debug code in the Business Connector or select Enable global breakpoints to debug code running in the Business Connector or client.
NoteBreakpoints are user specific. If you set a breakpoint, only the intended session will break for that breakpoint even if other users execute that code while the breakpoint exists. A global breakpoint will break on any breakpoint for any session running on the machine.
Click the Configuration Target: dropdown and select Business Connector (non-interactive use only).
Click the Manage button and then click Create configuration…
Give the Configuration a name like DebugNonIntOption and click OK.
On the Developer tab, select Enable user breakpoints to debug code running in the Business Connector or select Enable global breakpoints to debug code running in the Business Connector or client.
Click OK to apply changes and close window.
The following steps are only required if you want to debug X++ code that runs on the AOS server, if your code is client only code, for example Business Connector or desktop client, then the following steps are not required. This can be critical in production scenarios because applying the configuration changes require re-starting the server.
To set the configuration settings for code that runs on the AOS server
From the Start menu, point to Administrative Tools and then click Microsoft Dynamics AX Server Configuration.
Click the Manage button and then click Create configuration.
Give the Configuration a name like DebugServerOption and click OK.
On the Application Object Server tab, select Enable breakpoints to debug X++ code running on this server.
Click OK to apply changes and close window. You will be prompted to restart the service.
Enabling Debug in Microsoft Dynamics AX
The next step is to enable debug in the Microsoft Dynamics AX application.
To enable debug in Microsoft Dynamics AX
From the System administration navigation pane, click Common > Users.
Click the user that you want to debug, on the Action Pane, click Options.
In the Options window, click the Development link. In the Debug section, for the Debug mode field, click When Breakpoint.
Click Apply and close the Option and User windows.
Setting Breakpoints in Microsoft Dynamics AX
The following section describes how to set breakpoints in your X++ code.
To set breakpoints in Microsoft Dynamics AX
In the Application Object Tree (AOT), locate the method that you want to debug, right-click the method and click Edit.
Use F9 to include a breakpoint in your X++ code. For more information about breakpoints, see Using Breakpoints.
Invoking the Breakpoints in X++
Now that you have the configuration settings applied and Microsoft Dynamics AX enabled to break when you debug, the final step is to run the .NET-connected application. In this section you will run the application that will cause the breakpoint to occur.
To run the application
Start the .NET-connected application that uses the Microsoft.Dynamics.BusinessConnectorNet assembly. This will load the breakpoints for the current user.
Click Tools > Debugger.
Run the application that will cause the breakpoints to occur. When a breakpoint is encountered, Microsoft Dynamics AX will connect to an existing debugger process and displays the output in the Microsoft Dynamics AX Debugger window. For more information about how to use the Debugger, see Microsoft Dynamics AX Debugger.
Disabling the Debug Settings
When you are finished debugging the X++ code you must disable the debug settings. The following section describes the steps to remove the breakpoints and reset the configuration settings.
To disable the debug settings
In the AOT, locate the method that you set breakpoints in, right-click the method and click Edit.
Use F9 to remove a breakpoint, or use Ctrl+F9 to disable the breakpoint.
Click Tools > Options.
In the Options window, click the Development link. In the Debug section, for the Debug mode field, click No.
Click Apply and close the Option and User windows.
Set the configuration settings back to the previous configurations. From the Start menu, point to Administrative Tools and then click Microsoft Dynamics AX Configuration.
Click the Configuration drop down menu and click the previous or Original configuration.
In the Application Object Server Instance dropdown, select Local client.
Click the Configuration drop down menu and click the previous or Original configuration.
Click OK to apply changes and close window.
From the Start menu, point to Administrative Tools and then click Microsoft Dynamics AX Server Configuration.
Click the Configuration drop down menu and click the previous or Original configuration.
Click OK to apply changes and close window.
Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. get your copy at the MS Press Store
How to: Debug X++ Code Running in .NET Business Connector [AX 2012]的更多相关文章
- Change the environment variable for python code running
python程序运行中改变环境变量: Trying to change the way the loader works for a running Python is very tricky; pr ...
- How to implement long running flows, sagas, business processes or similar
转自:https://blog.bernd-ruecker.com/how-to-implement-long-running-flows-sagas-business-processes-or-si ...
- How to Debug Enterprise Portal Code in Dynamics AX 2009
转载 To set up debugging for pages1. Log into the server that is running the AOS.2. Open the Microsoft ...
- Why we made vorlon.js and how to use it to debug your JavaScript remotely
Vorlon.js is powered by node.JS, socket.io, and late-night coffee. I would like to share with you wh ...
- Build 2017 Revisited: .NET, XAML, Visual Studio
For the next couple months we're going to revisit Build 2017, each post focusing on different aspect ...
- How to debug .NET Core RC2 app with Visual Studio Code on Windows?
Simone Chiaretta (http://codeclimber.net.nz/archive/2016/05/20/How-to-debug-NET-Core-RC2-app-with-Vi ...
- HOW TO REMOTELY DEBUG APPLICATION RUNNING ON TOMCAT FROM WITHIN INTELLIJ IDEA
This post would look into how to tackle and debug issues in scenarios where they only occur in produ ...
- Visual Studio Debug only user code with Just My Code
Debug only user code with Just My Code By default, the debugger skips over non-user code (if you wan ...
- Debug with jdb
原文地址: http://www.javaworld.com/article/2077445/testing-debugging/debug-with-jdb.html Q: How do you u ...
随机推荐
- STM32F103C8T6-CubeMx串口收发程序详细设计与测试(2)——程序规划、代码编写及测试
摘要:演示程序的功能:通过中断接收串口数据,在1750us时间内没有收到新的字节的话,将收到的数据原封不动地发送出去,以测试串口的完整收发流程.对使用到的函数进行了说明,阐述了各个函数的调用顺序和调用 ...
- [学习笔记] 树上倍增求LCA
倍增这种东西,听起来挺高级,其实功能还没有线段树强大.线段树支持修改.查询,而倍增却不能支持修改,但是代码比线段树简单得多,而且当倍增这种思想被应用到树上时,它的价值就跟坐火箭一样,噌噌噌地往上涨. ...
- devops-持续集成管理之SonarQube
1. devops-持续集成管理之SonarQube 1) 代码质量七宗罪 编码规范:是否遵守了编码规范,遵循了最佳实践. 潜在的BUG:可能在最坏情况下出现问题的代码,以及存在安全漏洞的代码. 文 ...
- Java安全之Javassist动态编程
Java安全之Javassist动态编程 0x00 前言 在调试CC2链前先来填补知识盲区,先来了解一下Javassist具体的作用.在CC2链会用到Javassist以及PriorityQueue来 ...
- LVM创建及管理
安装lvm yum install -y lvm yum install -y lvm
- 2014年 实验四 B2B模拟实验(二)
[实验目的] ⑴.熟悉电子合同签订过程 ⑵.掌握网上招标的流程并体会招标对采购商带来的好处 [实验条件] ⑴.个人计算机一台 ⑵.计算机通过局域网形式接入互联网 ⑶.电子商务模拟实验室软件包. [知识 ...
- (数据科学学习手札97)掌握pandas中的transform
本文示例文件已上传至我的Github仓库https://github.com/CNFeffery/DataScienceStudyNotes 1 简介 开门见山,在pandas中,transform是 ...
- MeteoInfoLab脚本示例:LaTeX写数学公式
LaTeX是排版常用的语法,科学计算软件中也常用它来写数学公式(比如MatLab, Matplotlib等),MeteoInfo通过调用JMathLaTeX库也可以实现这样的功能.LaTeX的语法介绍 ...
- MeteoInfoLab脚本示例:风场矢量图
读取风场U/V变量数据,可以从U/V计算出风速:speed = sqrt(u*u+v*v).quiverm函数用来绘制风场矢量图,参数中包括U/V变量,如果要绘制彩色风场还需要第三个变量,这里是风速s ...
- BASH让标准输出和错误输出颜色不同
shell中运行的程序输出有标准输出(stdout)和错误输出(stderr)两种.当在终端中运行一个进程时,默认是stdout和stderr混在一起的,需要区分只能去读内容,人眼不容易快速区分. 如 ...