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 ...
随机推荐
- uBuntu安装其他版本Python
问题描述:阿里云服务器uBuntu版本为16.04,默认Python版本为2.7.12和3.5.2,但是FastAPI,仅支持3.6+版本,因此需要更高版本的Python. 注意:系统自带的Pytho ...
- Arduino Uno微控制器采用的是Atmel的ATmega328
参考:https://www.yiboard.com/thread-831-1-1.html 在本篇文章中,我们将详细介绍Arduino开发板的硬件电路部分,具体来说,就是介绍Arduino Uno开 ...
- [POI2005]SAM-Toy Cars 贪心+堆
[POI2005]SAM-Toy Cars 题目:Jasio 是一个三岁的小男孩,他最喜欢玩玩具了,他有n 个不同的玩具,它们都被放在了很高的架子上所以Jasio 拿不到它们:为了让他的房间有足够的空 ...
- Black-Lives-Matter-Resources
下载 Black-Lives-Matter-ResourcesBlack-Lives-Matter-Resources 关于最近在美国发生的事件的资源列表 链接 描述 由于(可选) 插入链接 在这里插 ...
- 带有Firebase的离子2:在OAuth 2中签名
介绍 这是一个指南,展示如何在Android上使用Firebase认证谷歌用户. 背景 虽然很多人都写过这个指南,但是他们没有解释一个关键的部分--为什么在执行了每一步之后仍然会看到认证错误12501 ...
- Vue:Vue-Cli 实现的交互式的项目脚手架
一.这份文档是对应 @vue/cli.老版本的 vue-cli 文档请移步https://github.com/vuejs/vue-cli/tree/v2#vue-cli-- Vue CLI 是一个基 ...
- 多测师讲解_python_pycharm基本实用操作__保存代码_
pycharm中中保存代码的方式: 方式一: 方式二: 第一步: 第二步:
- nullptr解决了什么问题
从0到NULL 在C++的世界中字面值0用来表示空指针,所以0可以当作所有指针类型的字面值.为了让语义更明确引入了NULL宏定义: #undef NULL #ifdef __cplusplus #de ...
- linux(centos8):基于java13安装rocketmq-4.7.1(解决jdk不兼容的报错)
一,Rocketmq是什么? 1, RocketMQ是一个队列模型的消息中间件,具有高性能.高可靠.高实时.分布式特点 相比kafka,rocketmq的实时性更强 2,官方网站: http://ro ...
- Centos6.X 手动升级gcc
操作环境 CentOS6.5 64bit,gcc原版本为4.4.7,不能支持C++11的特性,所以需要升级 [root@zengxj ~]# wget http://ftp.gnu.org/gnu/g ...