Creating a .NET Core Project

To create a project for a COBOL application that is to be deployed to .NET Core you use the dotnet new command.

Important: Before creating a .NET Core project in this way for the first time you must perform two initialization steps:
  • Specify the location of the Visual COBOL NuGet packages
  • Install the .NET Core project templates

See the Related information for more information.

The dotnet new command can take a number of different options but the format for the most commonly-used options is as follows:

dotnet new template -lang "COBOL" --name project-name

where template is the type of project you want to create.

After running this command, the folder project-name is created, and in it are the various required project files and one or more template source files depending on the value you specified for template.

Tip:

To see the possible values that you can specify for template, run the following command:

dotnet new --list -lang "COBOL"

Example:

To create a COBOL console application called COBOLConsoleAppForDotNet run the following command:

dotnet new console -lang "COBOL" --name COBOLConsoleAppForDotNet

Full information for the dotnet new command is available from Microsoft: .NET fundamentals - dotnet new.