NOTICE: Our Community is moving. Get more information.
Customer has a .NET managed code solution in which he has two projects.The first project is a main console application that generates an assembly called mainprog.exe.The second project is a Class Library project that generates an assembly called subprog.dll.Within the subprog project is a program called prog2.cbl.
mainprog.cbl calls this prog2 through the use of:
call "prog2" using ...
Because prog2 is not the name of the .dll on disk, the .dll needs to be loaded in order to make the entry point prog2 available to mainprog.
The customer has created an app.config file for the mainprog project which contains the following preload section which will cause the program to load the subprog.dll when it starts:
<MicroFocus.COBOL.Application> <Switches></Switches> <Environment></Environment> <Interop> <PreLoad> <add key="subprog.dll" value="managed" /> </PreLoad> </Interop> </MicroFocus.COBOL.Application>
When he runs this in development it works fine and the program prog2 is found without a problem.
When he moves the program to a production computer on which COBOL Server is installed, when he runs the program he gets a RTS error 173 that prog2 program name cannot be found.
It turns out that although the customer moved the mainprog.exe and subprog.dll to the production computer he did not move the mainprog.exe.config file which is automatically generated by Visual COBOL in the project output folder.
Since this file actually contains the required statement to preload the subprog.dll and it was missing, the subprog.dll was not loaded and thus the prog2 entry point could not be found.
Copying the .config file to the production system solved this problem.