skip to Main Content

.NET Transactional File Manager Migrated to GitHub

I have migrated the .NET Transactional File Manager project to GitHub from CodePlex. The library is also available as a Nuget Package. I originally wrote about it in this blog post.

The library allows you do enlist file I/O operations in transactions using System.Transactions. For example you can wrap a SQL Server insert and creation of a new file on disk in the same transaction, and commit or rollback the two operations together as a unit.

Example code:

// Wrap a file copy and a database insert in the same transaction
TxFileManager fileMgr = new TxFileManager();
using (TransactionScope scope1 = new TransactionScope())
{
    // Copy a file
    fileMgr.CopyFile(srcFileName, destFileName);

    // Insert a database record
    dbMgr.ExecuteNonQuery(insertSql);

    scope1.Complete();
}

This library is available as a NuGet package.

dotnet add package TxFileManager

Version 1.4 is now available with the following changes/fixes:

  • Convert to xUnit tests
  • Add support for custom temp paths to address issues with file/dir operations accross filesystems
  • Fix for resource leak in TxFileManager._txEnlistment
  • Target .NET Standard 2.0
  • Additional testing for .NET Core on Ubuntu
  • Additional stress testing both on Windows and Ubuntu
  • Created Github workflow to automatically build/test on ubuntu
  • Added FxCop static analysis

I occasionally blog about programming (.NET, Node.js, Java, PowerShell, React, Angular, JavaScript, etc), gadgets, etc. Follow me on Twitter for tips on those same topics. You can also find me on GitHub.

See About for more info.

This Post Has 0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top