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. Beyond Compare 3, 简体中文版 安装

    转载: 1.https://www.scootersoftware.com/download.php 2.http://www.scootersoftware.com/download.php 下载地 ...

  2. 十一、模拟扫码登录微信(用Django简单的布置了下页面)发送接收消息

    为了能够模拟登陆QQ,并获取信息.对扫码登录微信进行了分析.简单的用了一下Django将获取的信息映射到页面上.(python3+pycharm) 主要过程就是: 1.获取二维码 2.扫码登录(有三种 ...

  3. 使用MVC 5、Web API 2、KnockoutJS、Ninject和NUnit开发、架构和测试Web应用程序

    做一名微软软件开发人员就像在国际煎饼屋订早餐一样.每道菜都有一堆煎饼,你必须从各种各样的煎饼和糖浆口味中选择.对于web应用程序,解决方案堆栈是一组软件子系统或组件,用于交付功能完整的解决方案(无论是 ...

  4. 安装haproxy

    安装依赖 yum install -y gcc pcre pcre-devel openssl openssl-devel 创建依赖账号,并禁止账号登录 useradd -M -s /sbin/nol ...

  5. TP5调用小程序微信支付,回调,在待支付中再次调用微信支付

    1,必须要有 $mch_id $key $appid这三个值,是需要去申请的,我是直接用公司的2,购买商品订单号用户openid统一下单名称商品价格(必须以分为单位,调起微信支付)服务器的ip地址(没 ...

  6. 初始python模块

    Python语言中,模块分为三类. 第一类:内置模块,也叫做标准库.此类模块就是python解释器给你提供的,比如我们之前见过的 time模块,os模块.标准库的模块非常多(200多个,每个模块又有很 ...

  7. Linux执行脚本让进程挂掉后自动重启

    1 创建循环监听脚本  autostart.sh 例: 其中futures-market-server-v3andwebsoket.jar 是要监听的执行程序 #/bin/bashwhile true ...

  8. 【数论】HAOI2012 容易题

    题目大意 洛谷链接 有一个数列A已知对于所有的\(A[i]\)都是\(1~n\)的自然数,并且知道对于一些\(A[i]\)不能取哪些值,我们定义一个数列的积为该数列所有元素的乘积,要求你求出所有可能的 ...

  9. 某次burp抓包出错的解决办法

    前些日子同事发微信问我一个问题 没听懂他说的没回显是啥意思,于是叫他把站发给我. 浏览器不挂burp代理能正常打开,挂上burp代理以后浏览器显示连接超时 首先测试burp能抓其他的包应不是这个原因 ...

  10. Helium文档3-WebUI自动化-click点击

    前言 click点击方法在web UI自动化中使用频率非常高,此方法就是模拟鼠标左键单击动作 click入参说明 1.首先我们来分析一下click方法的代码 click(element):   &qu ...