Building a .NET Project

You build a project for a COBOL application that will be deployed to .NET in exactly the same way as you build a project for any other COBOL application. Targeting .NET does not change the way in which you build your application.

Note: You can also build a .NET project using the dotnet build command. See Building a .NET Project Using the Command Line for more information.

Native and .NET File Handler

By default, COBOL applications in .NET projects use the native file handler for their file handling operations. In order for the native file handling functionality to be available when the project is deployed and run, when you publish a .NET project the published files include the required native run-time system and file handler (as part of the MicroFocus.COBOL.Runtime package).

If you will be debugging a local .NET application on Windows where the main program is not COBOL, for example the main program is C#, you must ensure that an appropriate file handler is used. Failure to do so will result in run-time system error COBRT198 ("Load failure") on the first COBOL file I/O statement.

By default the 32-bit native version of the file handler will be available. For this to be used by your application you need to make sure the project for the main program is built to target the x86 platform.

Alternatively, to avoid any dependency on the native run-time system you can use the .NET file handler. You can switch a .NET project to use the .NET file handler rather than the native file handler by specifying the directives CALLFH(EXTFH) and CALLSORT(EXTSM) in the project.