当前位置: 代码迷 >> 综合 >> 在事务中使用异步方法报错A TransactionScope must be disposed on the same thread that it was created.
  详细解决方案

在事务中使用异步方法报错A TransactionScope must be disposed on the same thread that it was created.

热度:52   发布时间:2024-02-19 19:10:32.0

只需要将这个地方改一下就可以了哦

using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
{
    }
 using (TransactionScope ts = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)){
    }
  相关解决方案