In .NET applications

CPLEX Studio needs to locate .NET and ICU shared libraries.

The .NET API for OPL is provided as the assembly file oplall.dll, located in the opl\lib directory of CPLEX Studio. At run time, the oplall.dll assembly uses two other libraries: opl<version>_dotnet.dll and the cplex<version>.dll dynamic library. These libraries have some other dependencies on dbkernel.dll, dblnkdyn.dll, and ilog.dll.

CPLEX Studio also needs to find ICU libraries. ICU (International Components for Unicode) is a set of C/C++ and Java libraries that provides Unicode and Globalization support for CPLEX Optimization Studio. ICU is widely portable and gives applications the same results on all platforms and between C/C++ and Java software.

All these libraries are, by default, located in the opl\bin directory of CPLEX Studio.

For .NET applications to correctly invoke OPL objects, Windows searches the PATH environment variable to locate all these libraries.

Make sure that:

  • the PATH environment variable references the directory containing these shared libraries.

  • the PATH environment variable does NOT reference directories from other CPLEX Studio installations; this avoids versioning problems.

As an alternative solution, you can package all the necessary shared libraries directly with your application, in the same directory as the application executable. Windows will then always be able to find shared libraries located in the executable directory, without traversing the PATH environment variable.

For more information on the required libraries (.dll files), see Deployment of .NET applications (Windows only) in the Interfaces User’s Manual.