internal static Exception CreateEnlistmentStateException(Exception innerException, Guid distributedTxId)
{
string messagewithTxId = SR.EnlistmentStateException;
if (IncludeDistributedTxId(distributedTxId))
messagewithTxId = string.Format(SR.DistributedTxIDInTransactionException, messagewithTxId, distributedTxId);
TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
if (etwLog.IsEnabled())
{
etwLog.TransactionExceptionTrace(TransactionExceptionType.InvalidOperationException, messagewithTxId, innerException.ToString());
}
return new InvalidOperationException(messagewithTxId, innerException);
}