Skip to content

FileSystemWatcher with winforms Form as SynchronizingObject: event handlers not called on forms thread #52644

@msneijders

Description

@msneijders

Description

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?

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions