This topic has not yet been rated - Rate this topic

 http://msdn.microsoft.com/EN-US/library/bb190066.aspx

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

  1. From the Start menu, point to Administrative Tools and then click Microsoft Dynamics AX Configuration.

  2. Click the Manage button and then click Create configuration.

  3. Give the Configuration a name like DebugClientOption and click OK.

  4. 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.

  5. Click the Configuration Target: dropdown and select Business Connector (non-interactive use only).

  6. Click the Manage button and then click Create configuration…

  7. Give the Configuration a name like DebugNonIntOption and click OK.

  8. 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.

  9. 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

  1. From the Start menu, point to Administrative Tools and then click Microsoft Dynamics AX Server Configuration.

  2. Click the Manage button and then click Create configuration.

  3. Give the Configuration a name like DebugServerOption and click OK.

  4. On the Application Object Server tab, select Enable breakpoints to debug X++ code running on this server.

  5. 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

  1. From the System administration navigation pane, click Common > Users.

  2. Click the user that you want to debug, on the Action Pane, click Options.

  3. In the Options window, click the Development link. In the Debug section, for the Debug mode field, click When Breakpoint.

  4. 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

  1. In the Application Object Tree (AOT), locate the method that you want to debug, right-click the method and click Edit.

  2. 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

  1. Start the .NET-connected application that uses the Microsoft.Dynamics.BusinessConnectorNet assembly. This will load the breakpoints for the current user.

  2. Click Tools > Debugger.

  3. 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

  1. In the AOT, locate the method that you set breakpoints in, right-click the method and click Edit.

  2. Use F9 to remove a breakpoint, or use Ctrl+F9 to disable the breakpoint.

  3. Click Tools > Options.

  4. In the Options window, click the Development link. In the Debug section, for the Debug mode field, click No.

  5. Click Apply and close the Option and User windows.

  6. Set the configuration settings back to the previous configurations. From the Start menu, point to Administrative Tools and then click Microsoft Dynamics AX Configuration.

  7. Click the Configuration drop down menu and click the previous or Original configuration.

  8. In the Application Object Server Instance dropdown, select Local client.

  9. Click the Configuration drop down menu and click the previous or Original configuration.

  10. Click OK to apply changes and close window.

  11. From the Start menu, point to Administrative Tools and then click Microsoft Dynamics AX Server Configuration.

  12. Click the Configuration drop down menu and click the previous or Original configuration.

  13. 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]的更多相关文章

  1. 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 ...

  2. 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 ...

  3. 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 ...

  4. 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 ...

  5. 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 ...

  6. 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 ...

  7. 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 ...

  8. 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 ...

  9. Debug with jdb

    原文地址: http://www.javaworld.com/article/2077445/testing-debugging/debug-with-jdb.html Q: How do you u ...

随机推荐

  1. 基于Huggingface使用BERT进行文本分类的fine-tuning

    随着BERT大火之后,很多BERT的变种,这里借用Huggingface工具来简单实现一个文本分类,从而进一步通过Huggingface来认识BERT的工程上的实现方法. 1.load data tr ...

  2. 061 01 Android 零基础入门 01 Java基础语法 06 Java一维数组 08 一维数组总结

    061 01 Android 零基础入门 01 Java基础语法 06 Java一维数组 08 一维数组总结 本文知识点:一维数组总结 总结 注意点

  3. 07 Sublime Text3常用快捷键

    通用常用类(General) ↑↓←→:上下左右移动光标,注意不是不是 KJHL ! Alt:调出菜单 Ctrl + Shift + P:调出命令板(Command Palette) Ctrl + ` ...

  4. 《To C产品经理进阶》

    我所说的,都是错的. To C产品设计和To B产品设计对一个优秀的产品经理的洞察能力.架构能力有共通的要求. 实际产品设计过程中,To C产品往往是从商业思维思考,侧重用户研究,思考用户心智,由产品 ...

  5. 详解Class加载过程

    1.Class文件内容格式 2.一个class文件是被加载到内存的过程是怎样的? loading 把一个class文件装到内存里,class文件是一个二进制,一个个的字节 linking Verifi ...

  6. ansible-playbook调试

    1. ansible-playbook  1)ansible-playbook的语法检测 1 [root@test-1 bin]# ansible-playbook --syntax-check ng ...

  7. mysql linux 命令行操作

    1. 登录mysql      mysql -u 用户名 -p    回车输入密码 

  8. DBA提交脚步规范

    工作中需要走脚步流程,申请修改数据库,总结一些常用的语句:)提交时注明为DDL/DML_需求号_日期(各公司标准不一样)//修改字段长度使用;alter table t_task modify tas ...

  9. DM9000裸机驱动程序设计

    对于任何一个硬件模块的设计,首先第一步都是要先了解硬件本身后,再开始程序的软件设计.而由于DM9000的芯片文档内容很多,要驱动好网卡,需要很长时间,特别对于新手比较困难,所以可以参考linux内核代 ...

  10. 多测师讲解常用的测试工具分为10类_高级讲师肖sir

    我们将常用的测试工具分为10类. 1. 测试管理工具 2. 接口测试工具 3. 性能测试工具 4. C/S自动化工具 5.白盒测试工具 6.代码扫描工具 7.持续集成工具 8.网络测试工具 9.app ...