This project is read-only.

AddDirectory and Network Drive

Jan 11, 2011 at 3:40 PM

I seem to be having a problem with adding a mapped network drive to the AddDirectory method with the following error.  If I use a local drive, it works OK.  Any ideas?

 System.IO.DirectoryNotFoundException: Could not find a part of the path 'W:\Costpoint\70\Beta2\DSM'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Directory.InternalGetFileDirectoryNames(String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption)
   at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
   at System.IO.Directory.GetFiles(String path)
   at Ionic.Zip.ZipFile.AddOrUpdateDirectoryImpl(String directoryName, String rootDirectoryPathInArchive, AddOrUpdateAction action, Boolean recurse, Int32 level) in C:\DotNetZip\v1.9.1.5\DotNetZip\Zip Partial DLL\ZipFile.AddUpdate.cs:line 1944
   at Ionic.Zip.ZipFile.AddOrUpdateDirectoryImpl(String directoryName, String rootDirectoryPathInArchive, AddOrUpdateAction action) in C:\DotNetZip\v1.9.1.5\DotNetZip\Zip Partial DLL\ZipFile.AddUpdate.cs:line 1886
   at Ionic.Zip.ZipFile.AddDirectory(String directoryName, String directoryPathInArchive) in C:\DotNetZip\v1.9.1.5\DotNetZip\Zip Partial DLL\ZipFile.AddUpdate.cs:line 1830
   at Ionic.Zip.ZipFile.AddDirectory(String directoryName) in C:\DotNetZip\v1.9.1.5\DotNetZip\Zip Partial DLL\ZipFile.AddUpdate.cs:line 1760
   at DeltekSoftwareManagerAdministrator.frmMain.btnUpload_Click(Object sender, EventArgs e) in C:\Operations\main\DeltekProductDistribution\DeltekSoftwareManagerAdministrator\frmMain.vb:line 1030



Jan 12, 2011 at 2:48 AM

Could it be a permissions issue?

That seems the most likely possibility.  There's a file or directory that you don't have permissions on, in the mapped drive. DotNetZip is trying to read it, and failing.

Note: the failure is occurring in System.IO.Directory.GetFiles().  This library call in the System.IO namespace merely gets a list of files in a particular directory.  This is the thing that is failing, for the path shown in the error message.  You could try invoking that method in your own test application, to see if you get the same results. This might help track down the error for you.