I have a C# GUI application and am attempting to connect to an MQ channel using the IBM MQ API (that I have installed on my system). I have a reference to the amqmdnet.dll DLL in the "C:\Program Files\IBM\WebSphere MQ\bin" folder.
I try to instantiate an MQQueueManager object using the following code:
IBM.MQ.MQQueueManager qm = new IBM.MQ.MQQueueManager(qmNa
me, channel, connName);
The prototype for the MQQueueManager overloaded constructor used above is:
public MQQueueManager(string queueManagerName, string Channel, string ConnName);
However, upon executing this line of code, an exception is thrown saying "There is no MTS context available". I've attached a screenshot. I've Googled what I've found seems to be the error code for this (0x8004E004), and also a variation on the message ("no MTS object context"), but to no avail.
What's stranger is that I have fetched an earlier version of the code for my project and it works absolutely fine on the same machine. I've done a diff, but there doesn't appear to be any obvious differences that would impact on this particular function. I've even done a complete clean and rebuild to force a recompile and relink, and referenced DLLs are the same location on my hard disk. I'm now at a complete loss. Can anyone help me with pinpointing what could be causing this particular error?
Thanks for any help!