FileSystemWatcher Rename Event for Root-Folder to single character name like "a" -> Name is null
Description
If you rename a root-folder to something with a single letter like "a" the received RenamedEventArgs Name Property is null and the FullPath Proptery contains only the volume name like E:\. But it should contain E:\a.
Configuration
OS-Version: Windows 10 Pro 20H2 (x64) DotNet version: 5.0
It is not necessary should be root folder. Just any folder would do.
For rename actions in sub-folders I received the correct name. But I'll check it again.
using 3.1.1 runtime or lower fixes the problem, Any higher build and event .net 5 get this issue.
I have the same problem with .NET 5. It wasn't the case with previous .NET Framework versions. But the problem is not only for rename! The FileSystemWatcher doesn't even raise events when creating, deleting or changing a file or folder with single-character.
using 3.1.1 runtime or lower fixes the problem
@Jozkee is there any chance that you could take a look at this while you are fixing other FileSystemWatcher-related issues? If not please move it to 7.0
This issue was introduced by https://github.com/dotnet/runtime/pull/42419. It was backported to 5.0 (https://github.com/dotnet/runtime/pull/42420) and 3.1.9 (https://github.com/dotnet/corefx/pull/42989). that's why @Erfa1l is able to workaround it with 3.1.1.
It was fixed in 6.0 by https://github.com/dotnet/runtime/pull/42474.
Since 6.0 will release soon. Are you folks able to wait for the fix to be released and consume it upgrading to .NET 6?
If it was fixed in #42474, then we can close it. @Jozkee thanks!