.net 标准类库 - 不支持分布式事务错误 [英] .net standard class library - not support Distributed Transaction error

查看:35
本文介绍了.net 标准类库 - 不支持分布式事务错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 .net 标准类库项目中开发了一个日志服务.它在没有 System.Transaction (TransactionScope 类) 的情况下完美运行.
当我向进程添加事务时,记录器插入方法抛出异常.[此平台不支持分布式事务.]

I developed a logging service in .net standard class library project. It is perfectly working without System.Transaction (TransactionScope class).
When I add transaction to a process, logger insert method throws an exception. [This platform does not support distributed transactions.]

当我使用 System.Transaction 向核心控制台应用程序添加代码时,它可以工作.

When I add code to core console app with System.Transaction it works.

.net 标准 是否不支持 System.Transaction(TransactionScope)?

Is .net standard not supporting System.Transaction(TransactionScope)?

注意:目前:.net core 和 nugets 是最新的.

NOTE: For now : .net core and nugets are lastest.

  • 分发事务协调器服务正在运行,
  • EF Core 版本:2.1.0 preview2-final,
  • 类库版本 .NET Standard 2.0
  • AspNetCore 2.0.5


我意识到当我尝试在同一个 TransactionScope 块中打开同一个数据库中的第二个连接时会抛出异常.发布

推荐答案

您提到的错误消息指出这是在 .NET Core 上运行,并且您正在尝试使用/创建分布式事务.

The error message you are mentioning points to this is running on .NET Core and that you are trying to use/create a Distributed Transaction.

CoreFx repo 看来 .NET Core 不支持分布式事务.

Browsing the code for DistributedTransaction in the CoreFx repo it looks like Distributed Transactions are not supported on .NET Core.

这篇关于.net 标准类库 - 不支持分布式事务错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆