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. 《C++ primerplus》第13章练习题

    1.对CD类的派生练习.基类CD类存储作者和作品号等信息,派生类Classic额外增加一格"主要作品"的信息.主函数使用拷贝构造函数.按引用传递参数的函数和指针来测试基类和派生类的 ...

  2. P4568 [JLOI2011]飞行路线 / P2939 [USACO09FEB]Revamping Trails G

    题目描述 Link Alice 和 Bob 现在要乘飞机旅行,他们选择了一家相对便宜的航空公司.该航空公司一共在 \(n\) 个城市设有业务,设这些城市分别标记为 \(0\) 到 \(n-1\),一共 ...

  3. 如何使用 dotTrace 来诊断 netcore 应用的性能问题

    最近在为 Newbe.Claptrap 做性能升级,因此将过程中使用到的 dotTrace 软件的基础用法介绍给各位开发者. Newbe.Claptrap 是一个用于轻松应对并发问题的分布式开发框架. ...

  4. 一、Vuforia_AR

    一.AR概念: 增强现实(Augmented Reality,简称AR),是一种将虚拟信息与真实世界巧妙融合的技术,广泛运用了多媒体.三维建模.实时跟踪及注册.智能交互.传感等多种技术手段,将计算机生 ...

  5. 使用phpword获取doc中的表格数据

    1. 首先确定使用phpword是可以读取word文档中表格里面的数据, 使用的phpword版本0.17.0 2.理解word文档内容的存储逻辑规则(这里只做简单概述) 一般做博文喜欢直接贴代码,直 ...

  6. Swoole实时任务异步调用Demo

    server.php <?php class Server { private $serv; private $logFilePath = "/data/wwwroot/houtai/ ...

  7. nginx的脚本引擎(二)rewrite

    其实rewrite指令和上一篇说的if/set/return/break之类的没多大差别,但是rewrite用起来相对复杂,我就把他单独放到了这里.想要弄懂nginx的脚本引擎需要先明白处理reque ...

  8. 多测师讲解接口测试 _理论基础知识001_高级讲师肖sir

    前言: 我们今天进入接口测试的学习! 今天学习的内容是偏向理论 接口理论 了解接口测试(1) 一.什么是接口测试? 接口统称api,即程序与程序之间的对接.交接.交互.是测试系统组件间接口的一种测试. ...

  9. Git之多人协同开发

    一.获取远程库信息 1 2 3 $ git remote -v origin  https://github.com/xxxxx/node.git (fetch) origin  https://gi ...

  10. day40 Pyhton 并发编程03

    一.内容回顾 进程是计算机中最小的资源分配单位 进程与进程之间数据隔离,执行过程异步 为什么会出现进程的概念? 为了合理利用cpu,提高用户体验 多个进程是可以同时利用多个cpu的,可以实现并行的效果 ...