I have setup, a very long time ago, a clustered environment with MSMQ and using DTC (clustered also) and was able to place messages in the queue no problem using C#.
Today I needed to setup the same environment except using Windows Server 2012 and I managed to get it up and running. The only problem is, when I try to place a message on the queue, the app crashes with the following:
Unhandled Exception: System.Transactions.TransactionAbortedException: The transaction has aborted. ---> System.Transactions.TransactionException: MSDTC was unable to read its configuration information. (Exception from HRESULT: 0x8004D027) - --> System.Runtime.InteropServices.COMException: MSDTC was unable to read its configuration information. (Exception from HRESULT: 0x8004D027) at System.Transactions.Oletx.IDtcProxyShimFactory.ConnectToProxy(String nodeN ame, Guid resourceManagerIdentifier, IntPtr managedIdentifier, Boolean& nodeName Matches, UInt32& whereaboutsSize, CoTaskMemHandle& whereaboutsBuffer, IResourceM anagerShim& resourceManagerShim) at System.Transactions.Oletx.DtcTransactionManager.Initialize() --- End of inner exception stack trace --- at System.Transactions.Oletx.OletxTransactionManager.ProxyException(COMExcept ion comException) at System.Transactions.Oletx.DtcTransactionManager.Initialize() at System.Transactions.Oletx.DtcTransactionManager.get_ProxyShimFactory() at System.Transactions.Oletx.OletxTransactionManager.CreateTransaction(Transa ctionOptions properties) at System.Transactions.TransactionStatePromoted.EnterState(InternalTransactio n tx) --- End of inner exception stack trace ---
The app is pretty simple and straight forward. Used it many times. Works fine to local computer queues and same app was used last time, few years ago, to place a message on the transactional msmq in the cluster:
var anOrder = new Order { OrderID = 1, ShipToAddress = "123 Abc avenue", ShipToCity = "Seattle", ShipToCountry = "A country", ShipToZipCode = "12345", SubmittedOn = DateTime.UtcNow };
// create a MessageQueue to tell MSMQ where to send the message and how to connect to it
var configSettingQueue = ConfigurationManager.AppSettings["MessageQueuePath"];
var queue = new MessageQueue(configSettingQueue);
// Create a Message and set the body to the order object above
var msg = new Message { Body = anOrder };
// Create a transaction
using (var ts = new TransactionScope(TransactionScopeOption.Required))
{
queue.Send(msg, MessageQueueTransactionType.Automatic); // send the message
ts.Complete(); // complete the transaction
}
Any ideas? The DTC allows incoming and outgoing transactions and no authentication is required either.
stumped!
in the eventviewer, I get this:
Failed to initialize the needed name objects. Error Specifics: hr = 0x80004005, com\complus\dtc\dtc\msdtcprx\src\dtcinit.cpp:575, CmdLine: DNCDispatcher.exe, Pid: 1812
No SQL is installed or being used. Just clustered MSMQ.
After an hour... figured it out. You need to run the app in administrator/elevated privileges.
YUP. That worked.
User contributions licensed under CC BY-SA 3.0