Ok, I´ve tried this with this C# (.NetFramework 4.8) sample:
private string zipFilePath = @"\\?\D:\Data\TrainingFile.zip";
public TestClass()
{
string source = @"\\?\D:\Projects\MyData\*";
CreateZipFile(zipFilePath, source);
}
internal void CreateZipFile(string zipFilePath, string sourceDirectory)
{
try
{
using (ZipArchive archive = new ZipArchive(zipFilePath))
{
ArchiveOperationResult result = archive.Add(
sourceDirectory,
"/",
TraversalMode.Recursive,
TransferMethod.Copy,
ActionOnExistingFiles.OverwriteAll
);
Console.WriteLine(
"Added {0} file(s), {1} byte(s) to {2}.",
result.FilesAffected,
result.FilesUncompressedLength,
archive.FilePath
);
}
}
catch (Exception ex)
{
string exText = ex.Message;
}
}
But the "Add" failed with an exception saying:
"Illegal use of wildcards in path.
Parameter name: sourcePathOrMask"
Note: I´m using Rebex zip version 7.0.8720.0