views:

58

answers:

1

I am trying to send messages to MSMQ on Windows 7 using C#. The code is as below:

using(var q = new MessageQueue(".\Private$\hellomsmq"))
{
    q.Send(new Message());
}

But when I refresh in Computer Management the 'number of messages' (Message Queuing/Private Queues/hellomsmq) stays at 0. I did not get any exceptions/errors while performing send().

Can anyone help please. Thanks!

+1  A: 

Is that queue transactional? If so. I believe you have to send your message as a transaction or use the two-parameter version of Send with MessageQueueTransactionType.Single as the second parameter.

paxdiablo
thank you!!!!!!
Jeffrey C