我正在使用dontnet core 2.1
我遇到以下错误,该如何解决?
{System.PlatformNotSupportedException:该平台不支持 分布式交易。在 System.Transactions.Distributed.DistributedTransactionManager.GetDistributedTransactionFromTransmitterPropagationToken(Byte [] 传播令牌)位于 System.Transactions.TransactionInterop.GetDistributedTransactionFromTransmitterPropagationToken(Byte [] 传播令牌)
我的代码
try
{
using (var s= new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
{
// Running couple of insert / update and delete async operations
s.Complete();
}
}
catch (TransactionAbortedException ex)
{
}
注意:如果我删除TransactionScopeAsyncFlowOption.Enabled
,我最终会遇到另一个异常System.InvalidOperationException: A TransactionScope must be disposed on the same thread that it was created.