
File.Copy to UNC path location with service
I've got a two line code snippet that copies a file from a local directory to
a server share that's accessed via a UNC path.
When I run this code snippet in a Windows forms app, while logged in as
myself, it runs fine and the file is copied.
When I run this code snippet in a Windows service, even when the service is
running under my account, the code snippet fails with a
system.unauthorizedaccess exception and the file copy fails.
I've verified in the service code that the service is running under my
account right at the point of failure. The account happens to be a domain
administrator account. Also, the share on the remote server has Full Access
granted to this account.
Any ideas would be appreciated.
--------------------
Chris Williams
Sirana Software
www.sirana.com