Skip to main content

Hi together,

I'm trying to make a new C# Application and execute existing Cobol Code. My problem now is:

If i create a Cobol solution in Visual Studio and 

  • set the Output type to "Link Library", i can compile it to a .dll file, but couldn't add this file as a reference in my C# solution.
    • Error: Make sure that the file is accessible and is a valid Assembly or COM-Component
  • - set the Output type to "Class Library", i get lot of Errors. For example:
    • Error: COBCH0860 Object references must be specified at 01 level ...
    • Unknwown types; Redefines on incorrect field; Not a data name ...

Does anyone know how i can compile existing code files and import it to my new Application or fix my Problems above?

Hi together,

I'm trying to make a new C# Application and execute existing Cobol Code. My problem now is:

If i create a Cobol solution in Visual Studio and 

  • set the Output type to "Link Library", i can compile it to a .dll file, but couldn't add this file as a reference in my C# solution.
    • Error: Make sure that the file is accessible and is a valid Assembly or COM-Component
  • - set the Output type to "Class Library", i get lot of Errors. For example:
    • Error: COBCH0860 Object references must be specified at 01 level ...
    • Unknwown types; Redefines on incorrect field; Not a data name ...

Does anyone know how i can compile existing code files and import it to my new Application or fix my Problems above?

You need to select the Class Library project template from the managed code category. The Link Library template is for native .dlls and the Class Library template will generate a .NET assembly with a .dll extension. You can then add the COBOL project as a reference to the C# project.


You need to select the Class Library project template from the managed code category. The Link Library template is for native .dlls and the Class Library template will generate a .NET assembly with a .dll extension. You can then add the COBOL project as a reference to the C# project.

And do you know how i could avoid the Problems above (f.e. Object references must be specified at 01 level ...)?

And do you know how i could avoid the Problems above (f.e. Object references must be specified at 01 level ...)?

Sorry I must have missed this part of your first message.

If this is an existing native application that uses the native OO syntax and class libraries then you are not going to be able to compile it as managed code as they are not compatible.

Is this a Dialog System application by any chance?


Sorry I must have missed this part of your first message.

If this is an existing native application that uses the native OO syntax and class libraries then you are not going to be able to compile it as managed code as they are not compatible.

Is this a Dialog System application by any chance?

Hi Chris,

thanks so far for your quick responses.

No this isn't a Dialog System application. Our system uses direct winapi calls with the apigui classes from Netexpress.

So now we are looking for a solution to combine our native code with managed code. Do you know, how we can implement this? Or if there are documentation?

Regards Sebastian