Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - FileSystemWatcher not monitoring UNC folder

Reply
 
Old 05-05-2009   #1 (permalink)
Yash Ganthe


 
 

FileSystemWatcher not monitoring UNC folder

The MSDN documentation says that FSW can be used for monitoring
network paths and folders. I tried it with a simple application and
monitored \\server\share. This worked fine. I was logged in as a
domain user. The shared folder has full access granted to the domain
user.

When I use the FSW in a Win Service, the event handlers get
registered. But they are never invoked. The FSW does not respond to
the registered events. The Win service is configured to run using the
same domain user account.
The PC on which I am running the FSW and the Server, are both running
on Win XP SP2. The Win service works fine with a local folder.

This is the code:
filesystemwatcher = new FileSystemWatcher();
string pathval = ConfigurationManager.AppSettings
["pathval"];
string filterval = ConfigurationManager.AppSettings
["filterval"];
filesystemwatcher.Path = pathval;

filesystemwatcher.Filter = filterval;
filesystemwatcher.NotifyFilter =
NotifyFilters.LastAccess | NotifyFilters.LastWrite |
NotifyFilters.FileName | NotifyFilters.DirectoryName;
filesystemwatcher.InternalBufferSize += 81920;

filesystemwatcher.IncludeSubdirectories = true;
filesystemwatcher.Created += new
System.IO.FileSystemEventHandler(fsw_Changed);
filesystemwatcher.Changed += new
System.IO.FileSystemEventHandler(fsw_Changed);

filesystemwatcher.EnableRaisingEvents = true;

What could be the problem?

Thanks,
Yash

My System SpecsSystem Spec
Old 05-05-2009   #2 (permalink)
Cowboy \(Gregory A. Beamer\)


 
 

Re: FileSystemWatcher not monitoring UNC folder

My first thought is "what account are you running the service under". Can
you log in with that account and see if the app, not service, is still
working?

--
Gregory A. Beamer
MCP: +I, SE, SD, DBA

*********************************************
| Think outside the box!
|
*********************************************
"Yash Ganthe" <yashgt@xxxxxx> wrote in message
news:59ae6ba0-db18-4f08-842d-d6527641b429@xxxxxx
Quote:

> The MSDN documentation says that FSW can be used for monitoring
> network paths and folders. I tried it with a simple application and
> monitored \\server\share. This worked fine. I was logged in as a
> domain user. The shared folder has full access granted to the domain
> user.
>
> When I use the FSW in a Win Service, the event handlers get
> registered. But they are never invoked. The FSW does not respond to
> the registered events. The Win service is configured to run using the
> same domain user account.
> The PC on which I am running the FSW and the Server, are both running
> on Win XP SP2. The Win service works fine with a local folder.
>
> This is the code:
> filesystemwatcher = new FileSystemWatcher();
> string pathval = ConfigurationManager.AppSettings
> ["pathval"];
> string filterval = ConfigurationManager.AppSettings
> ["filterval"];
> filesystemwatcher.Path = pathval;
>
> filesystemwatcher.Filter = filterval;
> filesystemwatcher.NotifyFilter =
> NotifyFilters.LastAccess | NotifyFilters.LastWrite |
> NotifyFilters.FileName | NotifyFilters.DirectoryName;
> filesystemwatcher.InternalBufferSize += 81920;
>
> filesystemwatcher.IncludeSubdirectories = true;
> filesystemwatcher.Created += new
> System.IO.FileSystemEventHandler(fsw_Changed);
> filesystemwatcher.Changed += new
> System.IO.FileSystemEventHandler(fsw_Changed);
>
> filesystemwatcher.EnableRaisingEvents = true;
>
> What could be the problem?
>
> Thanks,
> Yash
My System SpecsSystem Spec
Old 05-05-2009   #3 (permalink)
Yash Ganthe


 
 

Re: FileSystemWatcher not monitoring UNC folder

As mentioned in the original post, the service is running under the
same account with which the FSW works with a simple application.

-Yash


On May 6, 6:41*am, "Cowboy \(Gregory A. Beamer\)"
<gbwo...@xxxxxx> wrote:
Quote:

> My first thought is "what account are you running the service under". Can
> you log in with that account and see if the app, not service, is still
> working?
>
> --
> Gregory A. Beamer
> MCP: +I, SE, SD, DBA
>
> *********************************************
> | * * * * * * * * * * Think outside the box!
> |
> *********************************************"Yash Ganthe" <yas...@xxxxxx> wrote in message
>
> news:59ae6ba0-db18-4f08-842d-d6527641b429@xxxxxx
>
>
>
Quote:

> > The MSDN documentation says that FSW can be used for monitoring
> > network paths and folders. I tried it with a simple application and
> > monitored \\server\share. This worked fine. I was logged in as a
> > domain user. The shared folder has full access granted to the domain
> > user.
>
Quote:

> > When I use the FSW in a Win Service, the event handlers get
> > registered. But they are never invoked. The FSW does not respond to
> > the registered events. The Win service is configured to run using the
> > same domain user account.
> > The PC on which I am running the FSW and the Server, are both running
> > on Win XP SP2. The Win service works fine with a local folder.
>
Quote:

> > This is the code:
> > filesystemwatcher = new FileSystemWatcher();
> > * * * * * * * *string pathval = ConfigurationManager.AppSettings
> > ["pathval"];
> > * * * * * * * *string filterval = ConfigurationManager.AppSettings
> > ["filterval"];
> > * * * * filesystemwatcher.Path = pathval;
>
Quote:

> > * * * * * * * *filesystemwatcher.Filter = filterval;
> > * * * * * * * *filesystemwatcher.NotifyFilter =
> > NotifyFilters.LastAccess | NotifyFilters.LastWrite *|
> > NotifyFilters.FileName | NotifyFilters.DirectoryName;
> > * * * * * * * *filesystemwatcher.InternalBufferSize += 81920;
>
Quote:

> > * * * * * * * *filesystemwatcher.IncludeSubdirectories = true;
> > * * * * * * * *filesystemwatcher.Created += new
> > System.IO.FileSystemEventHandler(fsw_Changed);
> > * * * * * * * *filesystemwatcher.Changed += new
> > System.IO.FileSystemEventHandler(fsw_Changed);
>
Quote:

> > * * * * * * * *filesystemwatcher.EnableRaisingEvents = true;
>
Quote:

> > What could be the problem?
>
Quote:

> > Thanks,
> > Yash
My System SpecsSystem Spec
Old 05-11-2009   #4 (permalink)
Damien


 
 

Re: FileSystemWatcher not monitoring UNC folder

On May 5, 12:04*pm, Yash Ganthe <yas...@xxxxxx> wrote:
Quote:

> The MSDN documentation says that FSW can be used for monitoring
> network paths and folders. I tried it with a simple application and
> monitored \\server\share. This worked fine. I was logged in as a
> domain user. The shared folder has full access granted to the domain
> user.
>
> When I use the FSW in a Win Service, the event handlers get
> registered. But they are never invoked. The FSW does not respond to
> the registered events. The Win service is configured to run using the
> same domain user account.
> The PC on which I am running the FSW and the Server, are both running
> on Win XP SP2. The Win service works fine with a local folder.
>
> This is the code:
> * * * * * * * * filesystemwatcher = new FileSystemWatcher();
> * * * * * * * * string pathval = ConfigurationManager.AppSettings
> ["pathval"];
> * * * * * * * * string filterval = ConfigurationManager..AppSettings
> ["filterval"];
> * * * * * * * * filesystemwatcher.Path = pathval;
>
> * * * * * * * * filesystemwatcher.Filter = filterval;
> * * * * * * * * filesystemwatcher.NotifyFilter =
> NotifyFilters.LastAccess | NotifyFilters.LastWrite *|
> NotifyFilters.FileName | NotifyFilters.DirectoryName;
> * * * * * * * * filesystemwatcher.InternalBufferSize +=81920;
>
> * * * * * * * * filesystemwatcher.IncludeSubdirectories = true;
> * * * * * * * * filesystemwatcher.Created += new
> System.IO.FileSystemEventHandler(fsw_Changed);
> * * * * * * * * filesystemwatcher.Changed += new
> System.IO.FileSystemEventHandler(fsw_Changed);
>
> * * * * * * * * filesystemwatcher.EnableRaisingEvents =true;
>
> What could be the problem?
>
> Thanks,
> Yash
The community content for FileSystemWatcher on MSDN specifically
mentions problems with it working across the network when the Internal
Buffer size is altered, and gives a link to
http://blogs.msdn.com/kimhamil/archi...uffersize.aspx.
Any help?

Damien
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
FileSystemWatcher Folder Rename .NET General
Question about FileSystemWatcher? PowerShell
WMP11 Not Monitoring Folder Vista music pictures video
FileSystemWatcher not reporting files in folder moved to Recycle Bin? .NET General
WMP 11 Folder Monitoring not working Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46