PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms FileSystemWatcher problems

Reply

FileSystemWatcher problems

 
Thread Tools Rate Thread
Old 12-12-2005, 10:38 PM   #1
=?Utf-8?B?Tmlja1o=?=
Guest
 
Posts: n/a
Default FileSystemWatcher problems


Hello,

I'm trying to use the filesystemwatcher to watch for changes to my windows
service's config file so that I can load the changes on the fly. However, I'm
running into some trouble doing so.

It seems that when I'm editing the config file in VS, it creates a temp file
in the directory marked as "appname.exe.config~<some random chars>.tmp". If I
have the fsw watch just the config file ie. appname.exe.config, no event is
raised when I change the file. When I change the filter to
"appname.exe.config*", a change event occurs but I have trouble reading from
the new config file. If I edit the file in Notepad, no tmp file is created
but 2 changed events are raised.

I have event handlers for all events (changed, created, renamed, deleted)
and changed is the only one that is raised. I'm not sure how the changes are
transferred from the tmp file to the .config file.

Can anyone shed some light as to what is happening? OR provide me with a
better way of loading changes on the fly?

Any help is appreciated! Thanks

Nicholas
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off