I have a windows service set to copy files from a local directory to a samba share.
The service connects via a UNC path to the server (i.e. \remoteserver\shareddir).
I have logged in as the user under which the service is running, and was able to both copy files and create files on the samba share, using the UNC path.
However, when running the service I am getting io exceptions that suggest a login error. I have run process monitor on that box, watching the service and I can see it finding the UNC path but getting a login error when trying to write to the share.
This is using plain vanilla .net System.IO.File.Copy call.
I don't understand the errors, as when logged in under the same user I am able to copy and create files on the share.
Any ideas?
Edit: Exception text
Error in main processing loop (DoWork()): Logon failure: unknown user name or bad password.
System.Exception: Error on MyService.ProcessExportTransferfileDirectories and values: D:\Export, \RemoteServer\intray, D:\Export\Archive ---> System.IO.IOException: Logon failure: unknown user name or bad password.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.__Error.WinIOError() at System.IO.File.Move(String sourceFileName, String destFileName)
at MyService.Consumer.BusinessLogic.WmsFacade.MoveAndArchiveFile(String sourceFolder, String targetFolder, String archiveFolder, String rootFolder, LogCategory logCategory, LogCounter logCounter) --- End of inner exception stack trace --- at MyService.Consumer.BusinessLogic.WmsFacade.MoveAndArchiveFile(String sourceFolder, String targetFolder, String archiveFolder, String rootFolder, LogCategory logCategory, LogCounter logCounter) at MyService.Consumer.BusinessLogic.WmsFacade.ProcessExportTransfer(IDictionary`2 fileDirectories) at MyService.Core.TimedWorkerProvider.DoWork()