TransactionScope throws an exception

I am sure this is the main question, but I can not find any solution for google here.

when I try to use this block of code, it throws an exception that is 'System.Activities.Statements.TransactionScope': the type used in the using statement must be implicitly converted to 'System.IDisposable'

using (TransactionScope trans = new TransactionScope()) { }

I just want to use TransactionScope in Linq code.

Thanks, Relationship

+5
source share
3 answers

You are probably using the wrong TransactionScope.

, , System.Transactions.TransactionScope, System.Transactions.dll. , ( ), "using System.Transactions".

+8

, System.Activities.Statements.TransactionScope, System.Transactions.TransactionScope. System.Transactions.dll.

:

public sealed class TransactionScope : IDisposable

, System.Activities.Statements.TransactionScope System.Activities.Statements,

System.Activities.Statements , . , , , , , .

.

+6

TransactionScope. System.Transactions. , System.Activities.Statements.

+2
source

All Articles