Long path support with file system watcher

Sharjeel Ahmed 5 Reputation points
2024-04-15T15:28:11.6566667+00:00

In our client application implemented in C# with .Net framework 4.8 (OS: Windows server), we are using file system watcher control to detect folder events. To support a long path we are using prefixes as \\?\ for local folders and \\?\UNC\ for network paths.
EnableRaisingEvents property is set to true

The network path works well with the long path prefix and receives events. However, when we add watcher on local folders with long path prefixes, an error throws with the message
The given path's format is not supported.

Please see the attached results with and without long path prefixes.

Thanks

Regards

FileSystemWatcher

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,076 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.