File.Copy() causes System.IO.DirectoryNotFoundException

Joined
Aug 16, 2010
Messages
1
Reaction score
0
Hi,

I am getting Directory not found exception in one of my clients machines in the file.copy() method.
The windows application I have buit copies a set of files and folders into the users drive and opens the files. The same application works fine in my system but when I deploy it in the clients machine the above error is thrown. The exact trace is this.

HTML:
Error Occurred because System.IO.DirectoryNotFoundException: Could not find a part of the path C:\Documents and Settings\kamal\Local Settings\Temp\Projects\Script.mts'. 
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) 
at System.IO.Directory.InternalCopy(String sourceFileName,String destFileName,Boolean overwrite) 
at System.IO.File.Copy(String sourceFileName,String destFileName,Boolean overwrite) 
at CRAFTgen.Settings.DeployFramework() in C:\Development\Sourcecode\craftgen\settings.cs: line 558 Please provide the correct QC settings

Upon googling I found at some sites that this error actually gets thrown sometimes when there is a rights or permission issue. The folders and files are created but still I get directory not found exception. Could anybody shed some light on this as to why this occurs or am doing something wrong. Has anyone else faced this issue?

Thanks,
Kamal Kannan
 
Joined
Dec 6, 2010
Messages
3
Reaction score
0
You should check:
  • Destination directory doesn't exists (or the whole path doesnt exists)
  • You have no rights to write to destination(for example you created destination dir as administrator in Win Vista/7 and then you try to access it as regular user)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top