Absent Member.
Absent Member.
1615 views

.NetCobol invoking C# - COBCH0845

I have a solution in VS named AllManaged.

It consists of 2 projects: CobolPrograms and CSharpPrograms.  (The VS book says that a project should not contain a mixture of languages.)

CobolPrograms contains 2 programs/classes: CobolMain and CobolSub.  Both are managed code.

CSharpPrograms contains 1 program/class: CSharpSub.  The NameSpace is CSharpPrograms.

All programs display their program name and “Hello World”.

CobolMain invokes CobolSub and CSharpSub.

 

When I compile the solution, I get error COBCH0845 in CobolMain saying “Unknown class ‘CSharpSub’”.

I have unsuccessfully tried the following:

. In CobolMain, I put in the ILUSING “CSharpPrograms” compiler directive.

. For Project CobolPrograms, I have added CSharpPrograms to the NameSpace Property.

. For Project CobolPrograms, I have added “C:\...\visual studio 2010\Projects\AllManaged\CSharpPrograms” to the Reference Paths Property.

 

0 Likes
1 Reply
Highlighted
Micro Focus Expert
Micro Focus Expert

You should only need to add a project reference for the C# project to the References folder of the COBOL project in Solution Explorer.

Right-click on References under the COBOL Project and select Add Reference.

Under the Projects tab select your C# project.

This should take care of it.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.