Ionic.Zip.AddSelectedFiles gives error "The entry name must be non-null and non-empty." when using "name !="

Feb 5, 2013 at 8:07 AM
I have the following code to create a zipfile;
   using (Ionic.Zip..ZipFile zip = new Ionic.Zip.ZipFile())
                zip.AddSelectedFiles(selection, sourceDirectory, recurse);                    
where selection is: (name != .log) AND (name != .log.txt)
sourceDirectory: \isis-abdev-pm1\c$\inetpub\wwwroot
recurse: true

When this is called I get the error: The entry name must be non-null and non-empty.
at Ionic.Zip.ZipEntry.Create(String nameInArchive, ZipEntrySource source, Object arg1, Object arg2)
at Ionic.Zip.ZipFile.AddOrUpdateDirectoryImpl(String directoryName, String rootDirectoryPathInArchive, AddOrUpdateAction action, Boolean recurse, Int32 level)
at Ionic.Zip.ZipFile._AddOrUpdateSelectedFiles(String selectionCriteria, String directoryOnDisk, String directoryPathInArchive, Boolean recurseDirectories, Boolean wantUpdate)
at Ionic.Zip.ZipFile.AddSelectedFiles(String selectionCriteria, String directoryOnDisk, Boolean recurseDirectories)
at UtilityFunctions.ZipDirectory(String zipFile, String sourceDirectory, Boolean recurse, String excludeFileFilter) in C:\c\UtilityFunctions.cs:line 202 (UtilityFunctions.ZipDirectory(C:\c\UtilityFunctions.cs:208))

However when I do the same but my selection is: name = .log AND name = .log.txt I get no error, but as expected the zip-file does not contain files.

Using other selections with "name !"= or "filename !=" result all in the same error, for example name != *.log also results in the error.

I need to zip a whole directory all the files expect the .log and .log.txt files. Can somebody explain what I am doing wrong?