Package.Open() exception: Access to path is denied
<p>I been trying to fix this problem for the whole day, but no matter what I do I keep on getting the same exception: UnauthorizedAccessException was unhandled  at line
 using (Package package = Package.Open(d.FullName, FileMode.Create, FileAccess.ReadWrite))</p>

<p>The full code is:</p>

<pre><code>NTAccount act = new NTAccount("c9lu-PC","c9lu");

DirectoryInfo d = System.IO.Directory.CreateDirectory(path);

DirectorySecurity security = d.GetAccessControl();

security.AddAccessRule(new    FileSystemAccessRule(act,FileSystemRights.FullControl,InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.None, AccessControlType.Allow));

d.SetAccessControl(security);

using (Package package = Package.Open(d.FullName, FileMode.Create, FileAccess.ReadWrite))     // where the exception occurs
{

    PackageHelper.createPart(package, "/pages.zip" , MediaTypeNames.Application.Zip,
                    (stream) =&gt;
                    {
                        using (var parts = ZipPackage.Open(stream, FileMode.Create))
                        {
                        }
                    }

                    );
}
</code></pre>

<p>I really don't know what the problem is, please help me out.</p>
