how To:debug x + + Code Running in. NET Business Connector [AX 2012]

Source: Internet
Author: User
Tags configuration settings microsoft dynamics

This topic have not yet been rated- Rate This topicHttp://msdn.microsoft.com/EN-US/library/bb190066.aspx

Updated: December 16, 2011

applies To: Microsoft Dynamics AX R3, Microsoft Dynamics AX R2, Microsoft Dynamics AX Feature Pack, Microsoft Dynamics AX 2012

The Microsoft Dynamics AX development environment enables to create a. net-connected application and integrate with Microsoft Dynamics AX. By using the. 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 broke points in the client configuration, and then enable debugging in the. NET Business Connec Tor configuration. For more information on debugger, see Microsoft Dynamics AX Debugger.

There is modes to debug. NET Business Connector Code; Interactive and non-interactive. A 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'll 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

ProceduresSetting the Configuration Settings to Enable Debug

In this section, you'll set the configuration settings to enable your X + + code to is debugged from a. net-connected application. The settings is 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 Enab Le global breakpoints to debug code running in the business Connector or client.

    Note

    Breakpoints is user specific. If you set a breakpoint, only the intended session would break for this breakpoint even if other users execute this code WH Ile the breakpoint exists. A Global Breakpoint would break on any breakpoint for any session running on the machine.

  5. Click the Configuration target:dropdown and select Business Connector (non-interactive with 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-debug code running in the business Connector or select enable Global breakpoints to debug code running on the business Connector or client.

  9. Click OK to apply changes and close window.

The following steps is only required if you want to debug X + + code that runs on the AOS server, if your code was client on Ly code, for example business Connector or desktop client, then the following steps is not required. This can is critical in production scenarios because applying the configuration changes require re-starting the server.

To set the configuration settings for code this runs on the AOS server
    1. From the Start menu, point to Administrative Tools and then click Microsoft Dynamics AX Server configuration.< /c3>

    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'll 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, 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 what to set breakpoints in your X + + code.

To set breakpoints in Microsoft Dynamics AX
    1. In the application Object Tree (AOT), locate the method, which is want to debug, right-click the method and click Edit.

    2. Use F9 to include a breakpoint in your X + + code. For more information on breakpoints, see Using breakpoints.

Invoking the breakpoints in X + +

Now so you had 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'll run the application that would cause the breakpoint to occur.

To run the application
    1. Start the. net-connected application that uses the Microsoft.Dynamics.BusinessConnectorNet assembly. This would load the breakpoints for the current user.

    2. Click Tools > Debugger.

    3. Run the application that would cause the breakpoints to occur. When a breakpoint is encountered, Microsoft Dynamics AX would connect to an existing debugger process and displays the OUTP UT in the Microsoft Dynamics AX Debugger window. For more information 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, which is 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 menu and click the previous or Original configuration.

  8. in the application Object Server Instance dropdown, select Local client.

  9. Click the Configuration Drop 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.< /c2>

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

  13. Click OK to apply changes and close window.

See alsoMicrosoft Dynamics AX debugger.net Business Connector overviewwalkthrough:integrate A application with Microsoft Dynamic S AX Using. NET Business Connector
announcements:new Book: "Inside Microsoft Dynamics AX # R3" now available. Get your copy at the MS press Store

How To:debug x + + Code Running in. NET business Connector [AX]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.