What are the causes and solutions to a CS0122 error when sending onto an MSMQ queue from C#?

Posted by Erick on Stack Overflow See other posts from Stack Overflow or by Erick
Published on 2010-04-22T19:54:35Z Indexed on 2010/04/22 21:03 UTC
Read the original article Hit count: 342

Filed under:
|

Having created a System.Messaging.MessageQueue using the MessageQueue(string queuePath) constructor, attempting to use MessageQueue.Send(obj) results in a 'Unable to generate a temporary class (result=1)' exception with the additional text: 'error CS0122: 'System.__ComObject' is inaccessible due to its protection level'.

The queue itself has full control given to EVERYONE. When querying the MessageQueue object for it's read write permissions, it returns SendAndReceive. What causes this error and how do you resolve it?

© Stack Overflow or respective owner

Related posts about c#

Related posts about msmq