Created On:  20 August 2012

Problem:

Microsoft documents that in a .NET managed code applications all shared assemblies that are used by the application must either be installed in the Global Assembly Cache (GAC) or they must be made located in the same folder as the startup program. They specifically state that the PATH environment variable will not be searched when attempting to locate assemblies that are called.

I have a need during development for my application to load different versions of assemblies, in different stages of development, under various conditions.  How can I configure my application to find the correct assembly if PATH cannot be used?

Resolution:

The .NET COBOL runtime does its best to provide the same level of searching as our native runtime does, so it has similar search loaders, this includes a searcher that does use the PATH environment variable. If the .DLL assemblies are located within the PATH they will be found and loaded. This was something that was added specifically to the .NET COBOL run-time system for backward compatibility with the native code implementation.