AddAllFromDirectory not found #182

Closed
opened 2026-01-29 22:07:54 +00:00 by claunia · 1 comment
Owner

Originally created by @CheetahChrome on GitHub (May 26, 2017).

Installed the latest version 0.16.1 via Nuget. Took the first example, then pulled in using SharpCompress.Archives.Zip and it fails stating AddAllFromDirectory does not exist. Also SaveTo exists but doesn't take a string but a stream. First example fails....

Is there an extension namespace to bring in?

Using .Net 3.5 which may be applicable.

--- Second example

Took second example:

using (var zip = File.OpenWrite("C:\\test.zip"))
using (var zipWriter = WriterFactory.Open(ArchiveType.Zip, zip))
{
     foreach (var filePath in filesList)
     {
        zipWriter.Write(Path.GetFileName(file), filePath);
     }
}

and Open needs the stream, which is fine and fixable, but then the third parameter of WriterOptions is not an enum; and it is unclear how it needs to be used.

Originally created by @CheetahChrome on GitHub (May 26, 2017). Installed the latest version 0.16.1 via Nuget. Took the first example, then pulled in `using SharpCompress.Archives.Zip` and it fails stating `AddAllFromDirectory` does not exist. Also `SaveTo` exists but doesn't take a string but a stream. First example fails.... Is there an extension namespace to bring in? Using .Net 3.5 which may be applicable. --- Second example Took second example: ``` using (var zip = File.OpenWrite("C:\\test.zip")) using (var zipWriter = WriterFactory.Open(ArchiveType.Zip, zip)) { foreach (var filePath in filesList) { zipWriter.Write(Path.GetFileName(file), filePath); } } ``` and `Open` needs the stream, which is fine and fixable, but then the third parameter of `WriterOptions` is not an enum; and it is unclear how it needs to be used.
Author
Owner

@adamhathcock commented on GitHub (May 27, 2017):

The code is here https://github.com/adamhathcock/sharpcompress/blob/master/src/SharpCompress/Archives/IWritableArchiveExtensions.cs

You need SharpCompress.Archives

@adamhathcock commented on GitHub (May 27, 2017): The code is here https://github.com/adamhathcock/sharpcompress/blob/master/src/SharpCompress/Archives/IWritableArchiveExtensions.cs You need `SharpCompress.Archives`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#182