Copying files with DLL's - Urgent

Hello all,
I have a (.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:
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:  \\\SourceFolder\fileName.  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.
Who is Participating?
Corey ScheichConnect With a Mentor DeveloperCommented:
Change your service to run under the user instead of system

This will make any application that is run by the service run under the user.

Services by default run under the System account which doesn't have any access to network shares.
The security context of a service is a bit different from user started programs, in that you have to specify, when you create the service, the account under which the service will run.

Also note that SystemLocal only has rights on the box it's running on.

imkiosksAuthor Commented:
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.
Corey ScheichDeveloperCommented:
No problem my pleasure
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.