Compiling .NET Core COBOL Projects

Prerequisites

In order for the Micro Focus COBOL extension to work with .NET Core 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.

Build a .NET Core COBOL Project

Your .cblproj or .sln .NET Core projects and solutions must be created with either Visual COBOL or Enterprise Developer for Visual Studio. The .cblproj must be stored in the same folder as the .sln file, or in a subfolder of it.

  1. Open the folder in Visual Studio Code.

    You can use a command provided by the C# extension to generate the tasks.json and launch.json file for your project.

  2. Invoke the Visual Studio Code Command Palette widget - click Ctrl+Shift+P.
  3. Scroll down and select Generate assets for .NET COBOL build and debug from the lists of tasks available for the palette.

    This generates a tasks.json and a launch.json file in a .vscode subfolder within the folder that holds your sources. You can use these files to build and to debug your project, respectively.

  4. Click Terminal > Run Build Task to build your project.

Alternatively, if you do not want to create a tasks.json file,Micro Focus COBOL provides an auto-generated build task for each .NET COBOL project file in the open folder:

  1. Click Terminal > Run Build Task, and select the auto generated build task, COBOL: dotnet build (projname.cblproj)

Next, see Debug .NET Core COBOL Projects.