Highlighted
Absent Member.
Absent Member.
1169 views

problema calling .NET from COBOL

[Migrated content. Thread originally posted on 22 January 2012]

Hi,
I'm doing a program that interface a .NET dll with 9.0.0 runtime.
I have included my .NET assembly in my COBOL programs and created the file .DEF
with NETDEFGEN utility. Then I used the following "CREATE" statement to create a new instance:

create "@ePrescription"
NAMESPACE is "ePrescription"
CLASS-NAME is "ePrescription"
CONSTRUCTOR is @CONSTRUCTOR1()
HANDLE is eprescr-handle
FILE-PATH is "bin\eprescr.xml".

I used FILE-PATH because the assembly does not reside in the GAC and is not in same directory as "wrun32.exe".
The runtime is in "D:\wfar\bin" directory.
The assembly is in "D:\wfar\bin\ePrescription" directory.
The "CREATE" statement successful, but "MODIFY" of first method goes in exception with the following message:

Unable to load file or assembly "ePrescriptionCore, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=null"
or one of its dependencies... unable to find the file specified.

If I put all DLL in the same directory as "wrun32.exe" working properly.
If I put all DLL in the "ePrescription" directory the program goes in exception, although the FILE-PATH was specified.

Any help here would be great.
Valerio
0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: problema calling .NET from COBOL

Yes, having the assemply not in the GAC or in the runtime directory is challenging. I believe you also need to make an entry in a text file called Netevents.ini

C:\Program Files\Micro Focus\Acucbl901\AcuGT\sample\dotnet\NETOBJECTS\ReadMeSetup.txt
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: problema calling .NET from COBOL

News!
If I change the name of the directory from "ePrescription" to "ePrescr" working properly!!!
I suspect there are problems with NAMESPACE or CLASS-NAME or DLL NAME... if equal to the name of directory goes in exception.
However, I'll try try with Netevents.ini...
thanks shjerpe
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.