Creating a new TarArchive seems to hold on to resources after disposing of it.
var temp = Path.Combine(ThisLocation, Path.GetRandomFileName());
CopyFiles(TheItems, temp);
var newTarball = Path.Combine(ThisLocation, "MyTarBall.tgz");
using (var archive = TarArchive.Create())
{
archive.AddAllFromDirectory(temp);
archive.SaveTo(newTarball, CompressionType.GZip);
}
//An exception of type 'System.IO.IOException' occurred in mscorlib.dll but was not handled in user code
//Additional information: The process cannot access the file 'New Text Document.txt' because it is being
//used by another process.
Directory.Delete(temp, true);
Creating a new TarArchive seems to hold on to resources after disposing of it.
The sample to repro is here: https://github.com/TheAngryByrd/SharpCompressHoldingOntoFiles/
Thanks!