If you have a comment on this topic, contact Aptify Documentation. If you want to return to the Aptify Community Site, please click here.

Recommendations for Debugging Code

This section provides two recommended approaches to debugging your code-based configurations for Aptify:

The sample application's Sample Code folder includes a Debug folder with a PDB file for each sample code project. You can use this file in conjunction with the distributed assemblies to run the projects in debug mode. (In other words, you do not need to recompile a sample project first before running in debug mode.)

Debugging Procedure 1: Use Breakpoints with External Program

Assuming that the class is already uploaded into Aptify, follow these steps to debug your code using Visual Studio's Start External Program option to launch the Aptify application when you begin debugging:

  1. Set the Solution Configuration to Debug, if not already specified.

    Confirm Debug Configuration
  2. Insert the breakpoint(s) where needed in your VB class.
  3. Build your VB Project.
  4. Copy the generated DLL and PDB files from the VB Project's Debug folder (typically, bin\debug) into your computer's Aptify program files directory (typically, C:\Program Files\Aptify 5.5).
  5. Upload the latest DLL into the Aptify Object Repository and close Aptify.
  6. Return to Visual Studio and open the Project Properties.
  7. Click the Debug tab.
  8. Browse or enter the path for the Aptify Shell.exe file in the Start external program field.

    Specify External Program
  9. Save the project.
  10. Click the Start Debugging button in Visual Studio.

    Start Debugging Button
  11. When the Aptify Login dialog appears, enter your test server and account information.
    • Note that the dialog's Server and User fields will be blank, even if you have configured your server's Startup.exe.config file to pre-populate information, since you are running Aptify Shell.exe rather than Startup.exe and have bypassed the information in the Startup.exe.config file.

  12. Access the feature related to the DLL you are testing. You should hit the breakpoint accordingly when that line of code is going to be executed.

Debugging Procedure 2: Use Breakpoints with Attach to Process

This procedure is similar to Debugging Procedure 1: Use Breakpoints with External Program, except you attach to an existing process rather than open a new instance of Aptify.

Assuming that the class is already uploaded into Aptify, follow these steps to debug your code using the Attach to Process option:

  1. Set the Solution Configuration to Debug, if not already specified.

    Confirm Debug Configuration
  2. Insert the breakpoint(s) where needed in your VB class.
  3. Build your VB Project.
  4. Copy the generated DLL and PDB files from the VB Project's Debug folder (typically, bin\debug) into your computer's Aptify program files directory (typically, C:\Program Files\Aptify 5.5).
  5. Upload the latest DLL into the Aptify Object Repository.
  6. Leave the Aptify application running and return to Visual Studio.
  7. Select the Debug > Attach to Process... menu item.

    Attach to Process Option

  8. Select the Aptify instance that is currently running and click Attach.
    • Be sure to select the correct instance if you have more than instance of Aptify currently running.

      Select Process
  9. After Visual Studio loads into debug mode, switch back to the Aptify application and access the feature related to the DLL you are testing. You should hit the breakpoint accordingly when that line of code is going to be executed.

Debugging Procedure 3: Use Test Handles

Follow these steps to use a test handle to assist with debugging code:

  1. Add a form or class with a main loop routine to your project.
  2. Write some code to call the desired functionality within your object.
  3. Change the project to a Windows Application and build.
  4. Enter breakpoints.

Keep in mind the following points related to this method:

  • It has the advantage of retaining edit and continue, which is useful for rapid iterations in the early stages of development.
  • It is usually best to compile your project as a DLL and integrate it into Aptify as a first task, just to make sure the object is being called properly.
  • Always test thoroughly once updating the Object Repository (to determine if something stopped working since using the test handle for debugging).
  • Aptify recommends that you remove the handle from the project once the code is production ready. It may confuse other developers or users not familiar with the method.

Copyright © 2014-2017 Aptify - Confidential and Proprietary