Jordi
Jordi

Reputation: 23237

FileSystemWatcher renamed event not raised when I rename the folder it's watching out

I've configured a FileSystemWatcher in order to it watches out on a folder C:\folder.

It's suddenly come up me a problem when I've changed the name of the folder it's watching out to another one, and it doesn't raise anything.

The question is: Does a FileSystemWatcher raise some event when changes are made on the same "object" it's watching out?

Upvotes: 1

Views: 1980

Answers (1)

Vadim Martynov
Vadim Martynov

Reputation: 8892

Renaming the directory you are watching will not raise a notification. Notifications are only raised for entries inside the directory you are watching. That is expected behavior which is explicit documented in remarks block for FileSystemWatcher.Renamed Event.

Upvotes: 5

Related Questions