View Only

Migrating VB6 application from IBM MQ v9.0 to IBM MQ v9.2

By Ram Subba Rao Chalamalasetti posted Tue November 02, 2021 03:16 AM



If you have VB6 application referencing IBM MQ v9.0 (or older) library “amqmdnet.dll”, then you could migrate to IBM MQ v9.2 without recompiling the VB6 application.

If you run your VB6 application which is compiled with IBM MQ v9.0 or prior release directly with IBM MQ v9.2, then there is a chance that you would hit the following exception

System.IO.FileNotFoundException: Could not load file or assembly 'amqmdnet, Version=, Culture=neutral, PublicKeyToken=dd3cb1c9aae9ec97' or one of its dependencies. The system cannot find the file specified. File name: 'amqmdnet, Version=, Culture=neutral, PublicKeyToken=dd3cb1c9aae9ec97'


In the above exception the version “” will depend on the version of IBM MQ using which the application is built with.

.NET framework libraries of IBM MQ v9.0 or prior version are built using .NET Framework v3.5. IBM MQ v9.1 or above are built with a minimum level of .NET framework v4.5.1.  The CLR version of .NET Framework 3.5 is 2.0 and the CLR version of .NET Framework 4.5.1 is 4.0, because of change in the CLR version’s any .NET application which is built using .NET Framework 3.5 cannot run directly with .NET Framework v4.5.1, the application must be recompiled with .NET Framework 4.5.1 or the following tag must be added in the App.config file of the application:



    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>




Since VB6 applications are run using VB.exe, the tags have to be added to “vb.exe.config” file, if there isn’t a file ,then create a  file by name “vb.exe.config” in the same directory where “vb.exe”  file is located. Add the following content into “vb.exe.config” file
<?xml version="1.0" encoding="utf-8"?>


<startup useLegacyV2RuntimeActivationPolicy="true">

<supportedRuntime version="v4.0"/>




By adding the above content, now VB6 applications which are compiled with IBM MQ v9.0 or prior can run with IBM MQ v9.2 without recompiling.

Note: The tags added to vb.exe.config file is applicable to all the VB6 applications running on that machine.