Home All Groups Group Topic Archive Search About

FileSystemWatcher UNC Path Invalid

Author
25 Jan 2006 5:42 PM
webgreginsf
I'm attempting to use the FileSystemWatcher class to monitor a folder on a
remote server.  My app is running as a Windows service, currently on an XP
machine, but it will be on Server 2003 in production.  Everything works fine
when I set the Path to a local drive (i.e. "C:\Test").  However, when I
attempt to set the Path to a UNC path to my remote folder (i.e.
"\\servername\share" with an actual server and share name of course), I
receive an error stating that "The directory name \\servername\share is
invalid."

I have read many posts and articles by others with this same issue.  The
common response is that they don't have the proper security settings for the
service.  I had checked and triple checked that for my service, however, and
my service is running with a domain account that has Full-Control access to
the directory in question.  Does anyone have any other ideas about what might
be causing this problem?  Any advice would be appreciated...

Thanks,
Greg

Author
26 Jan 2006 2:35 AM
Toff McGowen
what is the type of the exception?

tm


Show quoteHide quote
"webgreginsf" <webgregi***@discussions.microsoft.com> wrote in message
news:3C222082-D932-46D2-A752-568FFEB60396@microsoft.com...
> I'm attempting to use the FileSystemWatcher class to monitor a folder on a
> remote server.  My app is running as a Windows service, currently on an XP
> machine, but it will be on Server 2003 in production.  Everything works
fine
> when I set the Path to a local drive (i.e. "C:\Test").  However, when I
> attempt to set the Path to a UNC path to my remote folder (i.e.
> "\\servername\share" with an actual server and share name of course), I
> receive an error stating that "The directory name \\servername\share is
> invalid."
>
> I have read many posts and articles by others with this same issue.  The
> common response is that they don't have the proper security settings for
the
> service.  I had checked and triple checked that for my service, however,
and
> my service is running with a domain account that has Full-Control access
to
> the directory in question.  Does anyone have any other ideas about what
might
> be causing this problem?  Any advice would be appreciated...
>
> Thanks,
> Greg
Author
26 Jan 2006 4:52 AM
Michael D. Ober
By default, services run under an account (LocalSystem) that doesn't have
network access.  Configure your service to log in with an account that does
have network access.

Mike Ober.

Show quoteHide quote
"Toff McGowen" <t*@toff.com> wrote in message
news:%2380OvDiIGHA.2064@TK2MSFTNGP09.phx.gbl...
> what is the type of the exception?
>
> tm
>
>
> "webgreginsf" <webgregi***@discussions.microsoft.com> wrote in message
> news:3C222082-D932-46D2-A752-568FFEB60396@microsoft.com...
> > I'm attempting to use the FileSystemWatcher class to monitor a folder on
a
> > remote server.  My app is running as a Windows service, currently on an
XP
> > machine, but it will be on Server 2003 in production.  Everything works
> fine
> > when I set the Path to a local drive (i.e. "C:\Test").  However, when I
> > attempt to set the Path to a UNC path to my remote folder (i.e.
> > "\\servername\share" with an actual server and share name of course), I
> > receive an error stating that "The directory name \\servername\share is
> > invalid."
> >
> > I have read many posts and articles by others with this same issue.  The
> > common response is that they don't have the proper security settings for
> the
> > service.  I had checked and triple checked that for my service, however,
> and
> > my service is running with a domain account that has Full-Control access
> to
> > the directory in question.  Does anyone have any other ideas about what
> might
> > be causing this problem?  Any advice would be appreciated...
> >
> > Thanks,
> > Greg
>
>
>
Author
26 Jan 2006 4:42 PM
webgreginsf
Hi Mike and Toff,

Thank you very much for your input.  If you look at my original post you'll
see that I had configured my service to use a network domain account, so I
was puzzled as to why it wasn't working.  After messing around with it for
several painful hours yesterday, I finally figured out what the problem was. 
It turns out I had granted security access to the target directory for the
domain account I was using, which I thought was sufficient.  In reality, what
I needed to do was to log in to the server itself and grant rights to the
domain user to access the share, via the permissions button on the Sharing
dialog box.  Live and learn. :-)  Thanks again for your suggestions.

-Greg

Show quoteHide quote
"Michael D. Ober" wrote:

> By default, services run under an account (LocalSystem) that doesn't have
> network access.  Configure your service to log in with an account that does
> have network access.
>
> Mike Ober.
>
> "Toff McGowen" <t*@toff.com> wrote in message
> news:%2380OvDiIGHA.2064@TK2MSFTNGP09.phx.gbl...
> > what is the type of the exception?
> >
> > tm
> >
> >
> > "webgreginsf" <webgregi***@discussions.microsoft.com> wrote in message
> > news:3C222082-D932-46D2-A752-568FFEB60396@microsoft.com...
> > > I'm attempting to use the FileSystemWatcher class to monitor a folder on
> a
> > > remote server.  My app is running as a Windows service, currently on an
> XP
> > > machine, but it will be on Server 2003 in production.  Everything works
> > fine
> > > when I set the Path to a local drive (i.e. "C:\Test").  However, when I
> > > attempt to set the Path to a UNC path to my remote folder (i.e.
> > > "\\servername\share" with an actual server and share name of course), I
> > > receive an error stating that "The directory name \\servername\share is
> > > invalid."
> > >
> > > I have read many posts and articles by others with this same issue.  The
> > > common response is that they don't have the proper security settings for
> > the
> > > service.  I had checked and triple checked that for my service, however,
> > and
> > > my service is running with a domain account that has Full-Control access
> > to
> > > the directory in question.  Does anyone have any other ideas about what
> > might
> > > be causing this problem?  Any advice would be appreciated...
> > >
> > > Thanks,
> > > Greg
> >
> >
> >
>
>
>
>