runtime icon indicating copy to clipboard operation
runtime copied to clipboard

FileSystemWatcher Rename Event for Root-Folder to single character name like "a" -> Name is null

Open bernd5 opened this issue 6 years ago • 7 comments

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

bernd5 avatar Nov 25 '20 12:11 bernd5

It is not necessary should be root folder. Just any folder would do.

BlackPPoint avatar Dec 09 '20 05:12 BlackPPoint

For rename actions in sub-folders I received the correct name. But I'll check it again.

bernd5 avatar Dec 09 '20 08:12 bernd5

using 3.1.1 runtime or lower fixes the problem, Any higher build and event .net 5 get this issue.

Erfa1l avatar Mar 11 '21 21:03 Erfa1l

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.

devpaulw avatar Jul 05 '21 08:07 devpaulw

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

adamsitnik avatar Jul 22 '21 15:07 adamsitnik

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?

jozkee avatar Jul 22 '21 18:07 jozkee

If it was fixed in #42474, then we can close it. @Jozkee thanks!

adamsitnik avatar Jul 22 '21 18:07 adamsitnik