FileSystemWatcher within Windows service

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use FileSystemWatcher (FSW) to monitor a folder. The only
problem is this folder is on FTP server located on DMZ (outside my domain)
and FSW does not allow me to pass credentials in order to authenticate on
that folder.
Because of this, I mapped that folder on a computer within the domain.
Now, I was able to build a Windows app using FSW to raise an event whenever
a file was placed on FTP folder and it worked OK.
The problem is when I tried to do the same thing in a Windows Service
application I am getting the following error: "The directory name
P:\ftproot\Folder is invalid.".
Is there anything I am doing wrong and if not is there another way to listen
to an FTP folder?

Thanks in advance!
 
You cannot use a mapped drive when using a windows service, the service has
to run with no user context a mapped drive is setup when a user logs in, try
using a network share.
 
Back
Top