NServiceBus: System.Transactions.TransactionExcept

2019-07-04 12:01发布

问题:

I am getting this exception on my subscriber when I try to save a record to a database from within my Handle(T value) method in my IHandleMessages implementation. Does anyone know why that would happen? I think I remember that NServiceBus uses distributed transactions to make the handling of messages transactional, but I have no idea why it doesn't just "work" after running the "RunMeFirst.bat" file on both machines.

Any ideas?

回答1:

Found the answer. It looks like I needed to enable the "Allow Inbound" option under MSDTC Security settings. Does anyone know why the RunMeFirst.bat doesn't set this?



回答2:

The problem are (as @skb said) the MSDTC Security settings, and you can find a detailed explanation on how to set this permissions on this MSDN forum response: The partner transaction manager has disabled its support for remote/network transactions.