This project is read-only.


Nov 23, 2009 at 3:46 PM
Edited Nov 23, 2009 at 4:46 PM

This seems like a simple permissions issue, but I have not been able to resolve it.

Extracting from a console application works fine, but attempting to extract the same file from the same path results in a System.Security.Permissions.FileIOPermission exception saying that the zip file could not be read when executed from ASP.NET (2.0). I have set NTFS permissions to allow FULL control on the zip location path for the account used by the application pool (as well as Everyone to test). The error occurs when attempting ZipFile.Read. The zip extracts successfully if the application pool uses an administrator account. I have not been able to determine what is blocked using Process Monitor.

Any help is greatly appreciated.


Nov 23, 2009 at 5:32 PM

Gathered some additional information. The zip extracts successfully under ASP.NET when the application pool using the default NETWORK SERVICE account. It does not work running the application pool under a custom account, even if that account is made a member of the local Administrators group, but all other ASP.NET pages under the site execute properly using the custom account.

Using Process Monitor, I found that the following register queries appear when using the custom account but not when using the NETWORK SERVICE or administrator accounts that executed successfully:


HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-2827921166-394598822-1116896006-1010




HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-2827921166-394598822-1116896006-1010



Is it possible that the custom account is not working because it has no Windows user profile directories?


BTW, this dev environment is running IIS 7.5 on 64-bit Windows 7


Thank you!

Nov 23, 2009 at 9:37 PM

If I create FileStream objects separately to both read the zip and write each contained file, passing the streams to the ZipFile contstructor and ZipEntry.Extract methods, it works. Passing strings for the file paths to each of these results in what are reported as permissions errors. Oddness.

Nov 23, 2009 at 10:47 PM

I don't know what the problem might be. If I could see the full exception I might be able to make some sense of it.