Migrating individual cobol files to individual projects in Visual Cobol

[Migrated content. Thread originally posted on 15 April 2011]

Under Netexpress we generally compiled individual cbl files to gnt from the command line - if we move to Visual Cobol it looks like we would need solution with a separate project for each cbl ? Given that we have thousands of files it would clearly be a very time consuming process to do this manually through the IDE - is there a tool to automate this ?
  • Verified Answer

    Are you going to move to managed code or native code in Visual COBOL?

    The command line tools, cobol and cbllink are still present in Visual COBOL so you should still be able to compile as you did before if you are staying with native code.

    If you wish to go to managed code then you can also generate managed assemblies using the cobol.exe command along with the appropriate directives like -ilgen. see .NET Compiler directives.

    If you have an existing project or solution then it too can be built from the command line using the msbuild command.

    Visual Studio projects will generate .EXE or .DLL format applications only, .GNT is not supported, although you can generate .GNT using the command line.

    You might want to rethink the packaging method of these programs.
    In Visual Studio, it is more common to have many source programs that are grouped together into a single project which will generate a single assembly.

    This is much easier to maintain then having a separate project for each source program resulting in thousand of individual .DLLs.

    There is currently no utility for automating this project/solution creation process.

    Currently you would need to use the Visual Studio IDE to create the Solution/Project and then import the source into the projects.

    If you use the one project contains many source files approach this is a very simple task as there is an option to add existing COBOL items to a project which allows you to specify entire folders and multiple programs at one time.

  • This "see .NET Compiler directives" link is broken

  • I have now fixed the link referenced.