Search code examples
c#ibm-mqxms

XMSFactoryFactory.GetInstance(XMSC.CT_WMQ) returns Fatal error: Failed to initialize XMSFactoryFactory


I'm trying to connect to an IBM message queue using .net and MQ client v8.0.0.5 but I keep receiving the following error:

Fatal error. Failed to initialize XMSFactoryFactory

Could not load file or assembly 'IBM.XMS.Client.Impl, Version=8.0.0.5, Culture=neutral, PublicKeyToken=d2666ab12fca862b' or one of its dependencies.

The system cannot find the file specified.":"IBM.XMS.Client.Impl, Version=8.0.0.5, Culture=neutral, PublicKeyToken=d2666ab12fca862b

Here's what I've done so far:

  • Installed MQ Client v8.0.0.5 (x64) on my machine.
  • Referenced the following assemblies:
  • amqmdnet.dll
  • amqmdnsp.dll
  • amqmdxcs.dll
  • IBM.XMS.dll
  • IBM.XMS.Admin.dll
  • IBM.XMS.Client.Impl.dll
  • IBM.XMS.NLS.dll
  • IBM.XMS.Provider.dll
  • IBM.XMS.Util.dll

Now I also have version v7.5.0.4 installed on my machine and that is having no issues connecting to the queue.

One more thing I noticed is there are no assemblies for v8.0.0.5 in the GAC but the assemblies for v7.5.0.4 are present. Can that be the reason?

Unfortunately, I cannot remove v7.5.0.4 until have both the versions working normally.


Solution

  • Yes, MQ v8.0.0.5 XMS .NET assemblies not being in the GAC is most likely the cause.

    You can look at the alternative of using redirection, update app.config file to use the correct version of assemblies your application requires. Look into your MQ installation directory for a file called NonPrimaryRedirect.config. This file contains sample configuration required for application to look for a specific version of MQ/XMS .NET assembly. Copy the contents of this file to your application's app.config file and try. You must ensure all href attributes point to correct path.