Skip to content

FileSystemWatch EnableRaisingEvents not supported on MonoVM #63185

@srxqds

Description

@srxqds

Description

our code:

fileWatcher = new FileSystemWatcher(watchPath, "*" + watchFilter);
fileWatcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.Size;
fileWatcher.Changed += FileWatcher_Changed;
fileWatcher.EnableRaisingEvents = true;

Reproduction Steps

.net6.0 sdk
windows

Expected behavior

work correctly

Actual behavior

throw exception

System.PlatformNotSupportedException: This API is specific to the way in which Windows handles asynchronous I/O, and is not supported on this platform.
at System.Threading.ThreadPoolBoundHandle.BindHandle(SafeHandle handle)
at System.IO.FileSystemWatcher.StartRaisingEvents()
at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
at System.IO.FileSystemWatcher.set_EnableRaisingEvents(Boolean value)
at UnrealInit.RestartWatcher..ctor(Boolean bForceRestartWhenPlaying)
at UnrealInit.PluginLoader.Start()
at UnrealInit.PluginLoader.Init()

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions