Skip to main content

Problem:

When converting a CGI executable program created with Net Express to an ISAPI .DLL to run as an IIS extension, you may receive an IIS Server 500 error response when the HTML action calls a program.

Resolution:

When converting a CGI executable to an ISAPI .DLL you must ensure that the main program being called is compiled with the directives $SET WEBSERVER(ISAPI) CASE REENTRANT"2" and this program must be linked with the Shared Multi-threaded run-time system.

If this main .DLL calls any other COBOL subprograms or .DLLs then they must all be compiled with the REENTRANT"2" directive and they must also be linked with the same Shared Multi-threaded run-time system.

Since an ISAPI application must be multi-threaded, the entire application must be multi-threaded.

An IIS Server 500 error is seen because some of the subprograms within a .DLL being called by the main program were not compiled with REENTRANT"2" and they were linked to the Shared Single-threaded run-time system.

This caused the application to fail because it was trying to load 2 different versions of the COBOL run-time system.

When an ISAPI main program calls additional .DLLs, they should reside in the same directory as the main .DLL. You must also add this directory name to the Net Express PATH setting in the system Registry using REGEDIT.EXE.

Instructions for modifying this value can be found in the Net Express Distributed Computing manual under "Chapter 37:Deploying your CGI-based application>Deploying Your Application>Locating Dependencies in ISAPI and NSAPI Applications".

Old KB# 6939