473,383 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

FileSystemWatcher UNC Path Invalid

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
Jan 25 '06 #1
3 6833
what is the type of the exception?

tm
"webgreginsf" <we*********@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.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

Jan 26 '06 #2
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" <tm@toff.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
what is the type of the exception?

tm
"webgreginsf" <we*********@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.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



Jan 26 '06 #3
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

"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" <tm@toff.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
what is the type of the exception?

tm
"webgreginsf" <we*********@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.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



Jan 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: A.S. | last post by:
When i use FileSystemWatcher to monitor a local directory on my machine ,it works fine.But I need to monitor a file on a different server.So i set FileSystemWatcher1.path="\\server1\App\Data" ...
0
by: Brian | last post by:
Hello all. I've created a FileSystemWatcher that is to reside on Server A and monitor the activity of folder on Server B. The application works fine with watcher.path set to C:\. However,...
1
by: brian | last post by:
Hello all. I've created a FileSystemWatcher (ASP.Net w/VB.Net code behind pages) that is to reside on Server A and monitor the activity of folder on Server B. The application works fine with...
1
by: Troy Murphy | last post by:
How do I prevent the FileSystemWatcher event to keep firing while the file is being created? When copying a file to the watched folder, the event fires a dozen or more times! Also, the...
13
by: David | last post by:
I have been working on trying to write a directory watcher service. One of the requirments is that it be able to watch multiple directories, not sub directories of one parent directory, but just...
20
by: J-T | last post by:
We are working on an asp.net application which is a 3-tier application.I was aksed to create a component which monitors a folder and gets the file and pass them to a class library in our business...
1
by: PadovaBoy | last post by:
Hi! I try to develop a simple system for monitoring a sub directory of a web site and remake an xml file every time a sub-dir change it's name. I don't wont to use a window.service because, i want...
1
by: greg_slavin | last post by:
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...
12
by: ljh | last post by:
Has anyone else noticed that the FileSystemWatcher raises the changed event twice when a file is changed? Do you have any idea why this is the case?
5
by: Goran Djuranovic | last post by:
Hi all, I have a file system watcher service that works fine on a local hard drive, but will not work across the network. I tried both: mapping the drive and "\\..." path both no luck. I don't...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.