You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As another scenario I added another FileSystemWatcher to the parent directory and if I delete the parent directory from File Explorer, then undo the deletion to restore the parent directory there's some inconsistencies. The parent directory stops getting FSW notifications. But the sub-directory FSW continues to get events. Yet, it is now possible to rename the parent directory.
Original Comments
Feedback Bot on 5/23/2024, 09:13 AM:
(private comment, text removed)
anfirszo [MSFT] on 6/2/2024, 10:15 PM:
(private comment, text removed)
Cameron Miller on 6/13/2024, 01:19 AM:
(private comment, text removed)
Feedback Bot on 6/12/2024, 10:44 AM:
(private comment, text removed)
Original Solutions
(no solutions)
The text was updated successfully, but these errors were encountered:
This is just how Windows works, it blocks directories with open handles. FSW acquires a handle for the watched directory here.
This is non-actionable for us as there's nothing we can do on our side, this is also not exclusive to FileSystemWatcher, as I already mentioned.
A possible workaround is to first move the watched directories and the continue to move the parent ones. Or do a directory copy (that would be easier to achieve once #60903 gets resolved).
This issue has been moved from a ticket on Developer Community.
Using a slight variation of this MS Learn example https://learn.microsoft.com/en-us/dotnet/api/system.io.filesystemwatcher?view=net-8.0#examples
FileSystemWatcher
on the sub-directory (as per above example, although they may not all be needed)Expected behavior
Actual behavior
Interestingly, the parent directory is incorrectly locked against renaming, but deleting the parent folder succeeds.
Source:
As another scenario I added another
FileSystemWatcher
to the parent directory and if I delete the parent directory from File Explorer, then undo the deletion to restore the parent directory there's some inconsistencies. The parent directory stops getting FSW notifications. But the sub-directory FSW continues to get events. Yet, it is now possible to rename the parent directory.Original Comments
Feedback Bot on 5/23/2024, 09:13 AM:
(private comment, text removed)
anfirszo [MSFT] on 6/2/2024, 10:15 PM:
(private comment, text removed)
Cameron Miller on 6/13/2024, 01:19 AM:
(private comment, text removed)
Feedback Bot on 6/12/2024, 10:44 AM:
(private comment, text removed)
Original Solutions
(no solutions)
The text was updated successfully, but these errors were encountered: