sverrehundeide/MSMQCommander — pull request #6 by hmvs (2013-05-20 11:19:02+00:00)
Title: Fix exception while deleting message from transactional queue

Fixed following exception:

System.Transactions.TransactionAbortedException: The transaction has aborted. ---> System.Transactions.TransactionManagerCommunicationException: Communication with the underlying transaction manager has failed. ---> System.Runtime.InteropServices.COMException: The Transaction Manager is not available. (Exception from HRESULT: 0x8004D01B)
at System.Transactions.Oletx.IDtcProxyShimFactory.ConnectToProxy(String nodeName, Guid resourceManagerIdentifier, IntPtr managedIdentifier, Boolean& nodeNameMatches, UInt32& whereaboutsSize, CoTaskMemHandle& whereaboutsBuffer, IResourceManagerShim& resourceManagerShim)
at System.Transactions.Oletx.DtcTransactionManager.Initialize()
--- End of inner exception stack trace ---
at System.Transactions.Oletx.OletxTransactionManager.ProxyException(COMException comException)
at System.Transactions.Oletx.DtcTransactionManager.Initialize()
at System.Transactions.Oletx.DtcTransactionManager.get_ProxyShimFactory()
at System.Transactions.Oletx.OletxTransactionManager.CreateTransaction(TransactionOptions properties)
at System.Transactions.TransactionStatePromoted.EnterState(InternalTransaction tx)
--- End of inner exception stack trace ---
at System.Transactions.TransactionStateAborted.CheckForFinishedTransaction(InternalTransaction tx)
at System.Transactions.Transaction.Promote()
at System.Transactions.TransactionInterop.ConvertToOletxTransaction(Transaction transaction)
at System.Transactions.TransactionInterop.GetDtcTransaction(Transaction transaction)
at System.Messaging.MessageQueue.StaleSafeReceiveMessage(UInt32 timeout, Int32 action, MQPROPS properties, NativeOverlapped* overlapped, ReceiveCallback receiveCallback, CursorHandle cursorHandle, IntPtr transaction)
at System.Messaging.MessageQueue.ReceiveCurrent(TimeSpan timeout, Int32 action, CursorHandle cursor, MessagePropertyFilter filter, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType)
at System.Messaging.MessageQueue.ReceiveBy(String id, TimeSpan timeout, Boolean remove, Boolean compareId, Boolean throwTimeout, MessageQueueTransaction transaction, MessageQueueTransactionType transactionType)
at System.Messaging.MessageQueue.ReceiveById(String id, MessageQueueTransactionType transactionType)
at MsmqLib.QueueService.<>c__DisplayClass9.b__7(MessageQueue queue) in c:\Users\vadim.UR-HMVS\Documents\GitHub\MSMQCommander\MsmqLib\QueueService.cs:line 348
at MsmqLib.MessageQueueExtensions.ExecuteTransactional(MessageQueue queue, Action`1 action) in c:\Users\vadim.UR-HMVS\Documents\GitHub\MSMQCommander\MsmqLib\MessageQueueTransactionWrapper.cs:line 28
at MsmqLib.MessageQueueExtensions.Execute(MessageQueue queue, Action`1 action) in c:\Users\vadim.UR-HMVS\Documents\GitHub\MSMQCommander\MsmqLib\MessageQueueTransactionWrapper.cs:line 16
at MsmqLib.QueueService.DeleteMessage(MessageQueue messageQueue, String messageId, String& errorMessage) in c:\Users\vadim.UR-HMVS\Documents\GitHub\MSMQCommander\MsmqLib\QueueService.cs:line 348