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
{{ message }}
Repository navigation
FileSystemWatcher with winforms Form as SynchronizingObject: event handlers not called on forms thread #52644
Using FileSystemWatcher on a Winforms Form, setting SynchronizeObject to this form and adding a Changed event handler. This handler is executed on a different thread (worker thread) than this Form was created on (main thread). According to docs it should execute on the main thread?
I can confirm this, as i just came across this issue and wanted to write a bug report myself. Even if SynchronizingObject is set to a Control on the UI-Thread and InvokeRequired is true, the event handlers are called from a different thread.
Activity
Balkoth commentedon May 18, 2021
I can confirm this, as i just came across this issue and wanted to write a bug report myself. Even if
SynchronizingObjectis set to a Control on the UI-Thread and InvokeRequired is true, the event handlers are called from a different thread.thomsj commentedon May 23, 2021
I also noticed this, a couple of months ago. I've just committed my fix.
Fix invoking of `FileSystemWatcher`
Fix invoking of `FileSystemWatcher` (#53151)