The issue
I ran into a very strange problem while using the standard WinForms OpenFileDialog on Windows 11 together with a Synology Drive folder.
Everything looked normal at first. Search worked in regular folders, and it also worked in every subfolder of
C:\Synology\SynologyDrive. The only place where it consistently failed was the root folder itself:
C:\Synology\SynologyDrive.
Each time I typed something into the search box and pressed Enter, the dialog blinked for a split second as if it
was about to switch to search results, but then it immediately returned to the normal folder view.
Why it was so confusing
What made this especially hard to understand was how selective the problem was.
- Search in normal Windows Explorer still worked
- Search inside
OpenFileDialogworked in all subfolders ofC:\Synology\SynologyDrive - The same files copied to another regular local folder also worked correctly
- Rebuilding the Windows search index did not solve anything
Because of that, this did not look like a normal indexing problem, a WinForms problem, or a problem with the files themselves.
What finally solved it
The breakthrough came when I stopped opening the folder through its original path and accessed it through a junction instead.
For example, I created:
C:\Synology\SynologyDrive_J -> junction to -> C:\Synology\SynologyDrive
The files were exactly the same, but once I opened them through that junction path, search inside
OpenFileDialog started working correctly.
Why this points to the real cause
That result was very revealing.
Since the junction pointed to the exact same physical folder and files, the fix clearly was not about the content of the folder. It also did not point to a WinForms bug or to a broken Windows Search index.
Instead, it strongly suggested that the issue was tied to the shell state or folder identity of the exact original path
C:\Synology\SynologyDrive.
How to create the junction
To create a junction like this, you can use the following command:
mklink /J C:\Synology\SynologyDrive_J C:\Synology\SynologyDrive
Why this workaround works
The interesting part is that a junction changes the path identity that Windows Shell sees, while still leading to the same files.
In my case, the original root path seemed to be in a broken state, but alternative junction aliases pointing to that same folder worked without any problem. That makes this look path-specific rather than file-specific.
If you need a stronger fix
If your application cannot easily switch to another initial path, there is also a more aggressive version of the same workaround.
You can rename the real folder and then recreate the original path as a junction pointing to the renamed location. That way, applications can still use the old path, but Windows Shell sees it as a new folder identity.
This should be done carefully, preferably after a reboot and with Synology Drive Client fully stopped, because the folder may be locked by background processes.