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.
Note Breakpoints 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 ...
随机推荐
- Matlab中加汉明窗 ahmming 作用
转自:http://www.cnblogs.com/lxy2017/p/4049124.html 1.什么是汉明窗? 语音信号一般在10ms到30ms之间,我们可以把它看成是平稳的.为了处理语音信号, ...
- 怎么写一个Activity
a.新建一个类继承Actitvity b.重写oncreate方法 setContentView(R.layout.XXX);//设置布局文件 c.注册activity <activity an ...
- JavaScript innerTHML和createElement效率对比
前言: 在DOM节点操作中,innerTHML和createElement都可以实现创建元素.它们实现的功能类似,但是效率却相差很大.本文分别统计用innerTHML字符串拼接方式.innerTHML ...
- CPU 执行程序的秘密,藏在了这 15 张图里
前言 代码写了那么多,你知道 a = 1 + 2 这条代码是怎么被 CPU 执行的吗? 软件用了那么多,你知道软件的 32 位和 64 位之间的区别吗?再来 32 位的操作系统可以运行在 64 位的电 ...
- JVM 第四篇:可视化 JVM 故障处理工具
本文内容过于硬核,建议有 Java 相关经验人士阅读. 1. 可视化工具 在 JDK 中为我们提供了大量的 JVM 故障处理工具,都在 JDK 的 bin 目录下: 这其中除了大量的命令行工具以外,还 ...
- 持续集成工具之Jenkins安装部署
一.DevOps理念 所谓DevOps是指development和Operations的组合,中文意思就是开发和运维的简写.devops理念主要是针对企业中的研发人员.运维人员和测试人员的工作理念,是 ...
- shell-变量的数值运算let内置命令
1. let命令的用法 格式: let 赋值表达式 [注]let赋值表达式功能等同于:((赋值表达式)) 范例1:给自变量i加8 [root@1-241 scripts]# i=2 [root@1- ...
- 多测师_高级讲师肖sir讲解html中 Button跳转连接方法归纳
第一种方法: 1.1<a href="http://www.baidu.com"> <input type="button" name=& ...
- Ubuntu20.04 体验和美化
Ubuntu20.04美化和体验 windows用久了,换下系统也挺好的.ubuntu20.04优化后,用起来蛮舒服的. 系统配置 1.修改软件源 Ubuntu默认是国外的软件源, 我们可以手动切换为 ...
- logstash -grok插件语法介绍
介绍 logstash拥有丰富的filter插件,它们扩展了进入过滤器的原始数据,进行复杂的逻辑处理,甚至可以无中生有的添加新的 logstash 事件到后续的流程中去!Grok 是 Logsta ...