473,473 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

FileSystemWatcher events not firing

Hello,

For some reason the FileSystemWatcher events aren't firing. The code that
sets the event delegates
....

asmwatch.Path = AppDomain.CurrentDomain.BaseDirectory + "services\\";

asmwatch.Created +=new FileSystemEventHandler(asmwatch_Created);

asmwatch.Changed +=new FileSystemEventHandler(asmwatch_Changed);

asmwatch.NotifyFilter = NotifyFilters.FileName;

....
asmwatch is declared globally, both events suppose to show a message box
with information regarding. Problem is, these events never fire when I copy
or remove a file from the directory.

Any thoughts?
Thanks
--
Abdellah Elamiri
..net Developer
Efficacy through simplicity
Nov 16 '05 #1
1 6215
Nevermind, turns out I forgot to set EnableRaisingEvents to true

--
Abdellah Elamiri
..net Developer
Efficacy through simplicity
"A. Elamiri" <abdellahDOTelamiriATclintonDOTedutNOSPAM> wrote in message
news:ev**************@TK2MSFTNGP11.phx.gbl...
Hello,

For some reason the FileSystemWatcher events aren't firing. The code that
sets the event delegates
...

asmwatch.Path = AppDomain.CurrentDomain.BaseDirectory + "services\\";

asmwatch.Created +=new FileSystemEventHandler(asmwatch_Created);

asmwatch.Changed +=new FileSystemEventHandler(asmwatch_Changed);

asmwatch.NotifyFilter = NotifyFilters.FileName;

...
asmwatch is declared globally, both events suppose to show a message box
with information regarding. Problem is, these events never fire when I copy or remove a file from the directory.

Any thoughts?
Thanks
--
Abdellah Elamiri
.net Developer
Efficacy through simplicity

Nov 16 '05 #2

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

Similar topics

4
by: Josh Usovsky | last post by:
I'm setting up a watched folder using FileSystemWatcher. When I drop a small file into the watched folder, I can respond to a .Created event and process the file with other code. However, if I try...
3
by: Michael Stanbrook | last post by:
I'm using the FileSystemWatcher to looks for new files arriving in a directory. Files are coming in via FTP and tend to be larger is size (> 1MB at least). I would like to fire an event once the...
0
by: John Seaden | last post by:
Hi, anyone have any idea why I get duplicate changed events firing from a filesystemwatcher watching a file on a remote machine but not on the local machine? Any suggestions as to how to...
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...
2
by: Sagaert Johan | last post by:
Hi I use the FileSystemWatcher to detect creation of files. As soon as the event fires i do something with the file, but i sometimes get a sharing error. I noticed that when the event fires the...
3
by: Peter Kirk | last post by:
Hi I am trying to use FileSystemWatcher to watch for changes in a directory. The problem I am exepriencing is a double firing of an OnChanged event when a file is opened, edited, and saved. Why...
1
by: Peter Kirk | last post by:
Hi I am trying to use FileSystemWatcher to watch for changes in a directory. The problem I am exepriencing is a double firing of an OnChanged event when a file is opened, edited, and saved. Why...
3
by: Stampede | last post by:
Hi, I want to use the FileSystemWatcher in a Windows Service. I read an article, where the author created the FileSystemWatcher object in a seperate thread and when the event is fired, he started...
1
by: Robert van Poelgeest | last post by:
Hi We just upgraded to VS2005 but now the FileSystemWatcher no longer fires events under ASP.NET. We use the following code (which works under 1.1): private void AddFileSystemWatcher(string...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.