I am trying to debug some C# code and would appreciate your help.
This is my code.
sourceZipFile = objShell.NameSpace(@incomingZipFilesFolder.FullName + this.zipFile.Title);
try
{
//extract and copy all files
foreach (FolderItem2 file in sourceZipFile.Items())
{
log.createEntry("Extracting:"+file.Name);
destinationFolder.CopyHere(file, 4 | 16 );
}
}catch(Exception ex){
}
I am using Shell32 to unzip a zip file into a destination folder.
When running this code with visual studio on my server, everything works fine and the extracted files arrive in the destination folder.
When running this code as a service on the same server, the log file successfully shows:
Extracting: File1.txt Extracting: File2.txt Extracting: File3.txt
However, the files do not arrive in the destination folder. It shows that the loop works fine but the destination.CopyHere does not.
I am using a service account to run this code. The account has full AD permission on the source and destination folder. The code does not throw any errors.
Is there a way of making destinationFolder.Copy here return error output?
Just as a test I installed the service with my own Windows user, so the process was running with my user account and had admin rights on the server. The result was the same as running it with the service account.
I would appreciate any pointers.
Thanks
Regards
Toby