icsharpcode / SharpZipLib

#ziplib is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform.
http://icsharpcode.github.io/SharpZipLib/
MIT License
3.7k stars 976 forks source link

Could not load file or assembly 'System.Threading.Tasks.Extensions' or one of its dependencies #854

Open leefsmp opened 9 months ago

leefsmp commented 9 months ago

Describe the bug

Greeting Folks,

I am trying a basic sample inspired from the doc, but getting the following exception. What am I doing wrong?

"Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified."

private static void CreateArchive(string projectFolder)
{
    var tarPath = Path.Combine(projectFolder, "result.tar.gz");

    using (var outStream = File.Create(tarPath))
    using (var gzoStream = new GZipOutputStream(outStream))
    using (var tarArchive = TarArchive.CreateOutputTarArchive(gzoStream))
    {
        tarArchive.RootPath = projectFolder.Replace('\\', '/');

        foreach (var file in outputFiles)
        {
            var entry = TarEntry.CreateEntryFromFile(file);
            entry.Name = Path.GetFileName(file);
            tarArchive.WriteEntry(entry, true);
        }

        tarArchive.Close();
    }
}
Screenshot 2023-11-17 at 09 41 45

I installed the following Nuget packages, I'm not seeing a version 4.2.0.0 available ...

Screenshot 2023-11-17 at 09 50 11

Reproduction Code

No response

Steps to reproduce

build and run attached code

Expected behavior

valid tar.gz archive produced

Operating System

Windows

Framework Version

No response

Tags

Tar

Additional context

No response