ZipFile constructor does not thrown UnauthorizedAccessException

Apr 11, 2010 at 9:46 PM

Hello,

I have been tracing down an unusual behavior using this library.  While my zip (of type ZipFile) file does contain files, the ZipFile.ContainsEntry(string) was returning null.  A closer look showed that the zip.Entries property had 0 items.  This too was a false positive because again, the zip had data.  I looked deeper into the properties of the ZipFile and seen that the Stream properties showed an UnauthorizedAccessException in the debugger.  The issue was eventually identified as a standard 'Access Denied' error due to the lack of read permission of the executing user context. 

I would like to suggest that the constructor should throw the UnauthorizedAccessException because it could lead to unexpected behaviors at run-time. 

- Rashad Rivera

Coordinator
Apr 13, 2010 at 5:12 PM

Hi,

can you show me some code that demonstrates the problem you are seeing?

Apr 16, 2010 at 9:17 AM

Cheeso,

    I have tried to create a simpler project that demonstrates the issue, but I can't reproduce it that way.  I have a rather large project that involves a service.  When I figure out how to pin-point and/or reproduce; I'll post it here.

- Rashad Rivera

Coordinator
Apr 21, 2010 at 5:09 PM

Ok, keep me posted.