imkiosks
asked on
Copying files with DLL's - Urgent
Hello all,
I have a VB.net (.net 2003) windows service which includes in it a C# .dll. This dll has a variety of responsibilites, among which is to copy a file from one machine to another. The code works perfectly except for the line of code which does the copying:
System.IO.File.Copy(source FilePath,t argetFileP ath,true);
I am using the System.IO.File object to do the copying. At the top of the dll, I have the "directive": using System.IO; The error I am getting is: Cannot find file... but the file IS there. I wrote a quick sample windows forms application to copy the file, and it works fine. The windows service is running on the target machine, and the source file is sitting on another machine. Both are on their own private network. I am specifying the source path by using UNC: \\10.1.1.1\SourceFolder\fi leName. Both machines have the same user account, for ease of accessibility, the source folder is shared, and I have gone through the sharing and security permissioning to make sure everything is right. Could this have something to do with the fact that I am trying to copy files from within a running windows service?? Do I need to add the Network Service user to something?
This is very high priority for me - I have a deliverable tomorrow. Hardware is being shipped out!
Any help would be appreciated. Thanks.
I have a VB.net (.net 2003) windows service which includes in it a C# .dll. This dll has a variety of responsibilites, among which is to copy a file from one machine to another. The code works perfectly except for the line of code which does the copying:
System.IO.File.Copy(source
I am using the System.IO.File object to do the copying. At the top of the dll, I have the "directive": using System.IO; The error I am getting is: Cannot find file... but the file IS there. I wrote a quick sample windows forms application to copy the file, and it works fine. The windows service is running on the target machine, and the source file is sitting on another machine. Both are on their own private network. I am specifying the source path by using UNC: \\10.1.1.1\SourceFolder\fi
This is very high priority for me - I have a deliverable tomorrow. Hardware is being shipped out!
Any help would be appreciated. Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OMG,
Of course, of course, of course!!!!
I knew that. I have done just that many times before. Shame on me for overlooking such a simple setting. Well, when you're under pressure - nothing works right (i guess... :-/ )
Thanks, Corey - you saved my butt.
Of course, of course, of course!!!!
I knew that. I have done just that many times before. Shame on me for overlooking such a simple setting. Well, when you're under pressure - nothing works right (i guess... :-/ )
Thanks, Corey - you saved my butt.
No problem my pleasure
Also note that SystemLocal only has rights on the box it's running on.