I am trying to use MSMQs as below
string _QueueName = "\\MyServer\MyQueue";
if ( MessageQueue.Exists(_QueueName) ) // Error here
{
_Queue = new MessageQueue(@"FormatName:DIRECT=OS:" + _QueueName);
_Queue.Formatter = new XmlMessageFormatter(new Type[] { typeof(MyItem) });
}
My application compiles and runs successfully on windows 7 64 bit machine. If I take the same dlls on windows 8.1 and run without compiling on 8.1, I get this error
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
Please note that both are 64 bit machines. I have installed MSMQ Windows Features on both machines. Any ideas what could be the problem?
The event viewer displays
ERROR in MyApplication.MyFunction An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
Call Stack:
at
System.Messaging.Interop.SafeNativeMethods.IntMQPathNameToFormatName(String pathName, StringBuilder formatName, Int32& count)
at System.Messaging.Interop.SafeNativeMethods.MQPathNameToFormatName(String pathName, StringBuilder formatName, Int32& count)
at System.Messaging.MessageQueue.ResolveFormatNameFromQueuePath(String queuePath, Boolean throwException)
at System.Messaging.MessageQueue.Exists(String path)
User contributions licensed under CC BY-SA 3.0