Debugging .NET COBOL Projects


In order for the Micro Focus COBOL extension to work with .NET COBOL projects, you need the following software installed:

  • A licensed installation of one of the following Micro Focus products, release 7.0 or later:
    • Visual COBOL for Visual Studio or Enterprise Developer for Visual Studio
    • Visual COBOL Build Tools or Enterprise Developer Build Tools
    • Visual COBOL Development Hub or Enterprise Developer Unix Components
    Note: Visual COBOL for Eclipse, COBOL Server, Enterprise Developer for Eclipse, and Enterprise Server are not supported.
  • Microsoft's C# extension version 1.23.12 or later for Visual Studio Code.
  • Other software requirements - see the product Help of Visual COBOL for Visual Studio or Enterprise Developer for Visual Studio for any requirements for compiling .NET Core projects.

Register COBOL debugging support

Before you can debug .NET COBOL projects, you need to register the COBOL debugging support. You only need to do this once:

  1. Invoke the Visual Studio Code Command Palette widget - click Ctrl+Shift+P.
  2. Scroll down and select the COBOL: Register COBOL support with .NET Core debugger (vsdbg) command.

    This adds the COBOL support to the .NET debugger. If Microsoft's C# extension is not installed, this action will install it as well.

Debug a .NET COBOL project

To launch debugging, you must define a launch configuration in the launch.json file.

  1. See Compile .NET COBOL Projects for information about how to create a launch.json file for your project.
  2. Note that the launch.json file includes launch configuration of type coreclr which is provided by the C# extension. The following is an example of a launch configuration:
                "name": ".NET Core Launch (console)",
                "type": "coreclr",
                "request": "launch",
                "preLaunchTask": "COBOL: dotnet build",
                // Specify the executable that should be debugged below
                "program": "${workspaceFolder}/bin/Debug/net6.0/demo.exe",
                "args": [],
                "cwd": "${workspaceFolder}",
                // For more information about the 'console' field, see
                "console": "internalConsole",
                "stopAtEntry": false
  3. Click Run > Start Debugging and debug your project in the usual way.