-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FileSystemWatcher with winforms Form as SynchronizingObject: event handlers not called on forms thread #52644
Comments
Tagging subscribers to this area: @carlossanlop Issue DetailsDescriptionUsing Small test solution: WinFormsApp_FileSystemWatcher.zip Configuration.NET 5.0.6 Regression?It is at least a regression coming from .NET Framework 4.7.1, but I haven't tested a previous .NET Core version.
|
I can confirm this, as i just came across this issue and wanted to write a bug report myself. Even if |
I also noticed this, a couple of months ago. I've just committed my fix. |
Call `protected` `On...` event raising methods from `Notify...` methods, to invoke `SynchronizingObject` when required. Fix dotnet#52644
Call `protected` `On...` event raising methods from `Notify...` methods, to invoke `SynchronizingObject` when required. Fix #52644
Description
Using
FileSystemWatcher
on a WinformsForm
, settingSynchronizeObject
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?Small test solution:
WinFormsApp_FileSystemWatcher.zip
Configuration
.NET 5.0.6
Regression?
It is at least a regression coming from .NET Framework 4.7.1, but I haven't tested a previous .NET Core version.
The text was updated successfully, but these errors were encountered: