Как обрабатывать распаковку ZipFile с помощью слишком длинных / дублированных путей

При разархивировании файлов в Windows у меня иногда возникают проблемы с путями

that are too long for Windows (but okay in the original OS that created the file). that are "duplicate" due to case-insensitivity

Используя DotNetZip,ZipFile.Read(path) При чтении zip-файлов с одной из этих проблем вызов будет сорван. Это означает, что я даже не могу отфильтровать его.

using (ZipFile zip = ZipFile.Read(path))
{
    ...
}

Каков наилучший способ справиться с чтением таких файлов?

Updated:

Пример почтового индекса здесь: https://github.com/MonoReports/MonoReports/zipball/master

Дубликаты: https://github.com/MonoReports/MonoReports/tree/master/src/MonoReports.Model/DataSourceType.cs https://github.com/MonoReports/MonoReports/tree/master/src/MonoReports.Model/DatasourceType.cs

Вот более подробно об исключении:

Ionic.Zip.ZipException: Cannot read that as a ZipFile
---> System.ArgumentException: An > item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add)<br> at System.Collections.Generic.Dictionary2.Add(TKey key, TValue value)
at Ionic.Zip.ZipFile.ReadCentralDirectory(ZipFile zf)
at Ionic.Zip.ZipFile.ReadIntoInstance(ZipFile zf)

Resolution:

Основываясь на предложении @ Cheeso, я могу читать все из потока, избегая дублирования и проблем с путями:

//using (ZipFile zip = ZipFile.Read(path))
using (ZipInputStream stream = new ZipInputStream(path))
{
    ZipEntry e;
    while( (e = stream.GetNextEntry()) != null )
    //foreach( ZipEntry e in zip)
    {
        if (e.FileName.ToLower().EndsWith(".cs") ||
            e.FileName.ToLower().EndsWith(".xaml"))
        {
            //var ms = new MemoryStream();
            //e.Extract(ms);
            var sr = new StreamReader(stream);
            {
                //ms.Position = 0;
                CodeFiles.Add(new CodeFile() { Content = sr.ReadToEnd(), FileName = e.FileName });
            }
        }
    }
}

Ответы на вопрос(2)

Ваш ответ на вопрос