Debug NetLogic locally

Identify, investigate, and fix issues with NetLogic code by locally using Visual Studio or Visual Studio Code.

To debug NetLogic remotely, see Debug NetLogic remotely.

Tip: NetLogic errors are reported at runtime in the FactoryTalk Optix Studio log panel. NetLogic runtime errors are reported in the tab of the target on which the application runs (for example, Emulator Output). The design-time NetLogic errors are reported in the Output tab.

For more information, refer to the external code editor documentation.

Prerequisites

To debug NetLogic
  1. From the main toolbar, select Open .NET Solution.
    The default external code editor opens.
    Tip: Rockwell Automation recommends using Microsoft Visual Studio 2022 or Microsoft Visual Studio Code as the default code editor. Some development assistance features may not be available when using a different code editor.
  2. Debug either:
    • Runtime NetLogic. In the external code editor, debug FTOptixRuntime and in FactoryTalk Optix Studio, select Run.

      Tip: You can run the project on the Emulator target for debugging.
    • Design-time NetLogic. In the external code editor, debug FTOptixStudio and in FactoryTalk Optix Studio, right-click a NetLogic and select a method to execute.

  3. Stop the debugger and application runtime and then edit the code.
  4. Repeat 2.