Skip to content
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

FileSystemWatch EnableRaisingEvents not supported on MonoVM #63185

Closed
srxqds opened this issue Dec 29, 2021 · 3 comments · Fixed by #64834
Closed

FileSystemWatch EnableRaisingEvents not supported on MonoVM #63185

srxqds opened this issue Dec 29, 2021 · 3 comments · Fixed by #64834
Labels
Milestone

Comments

@srxqds
Copy link
Contributor

srxqds commented Dec 29, 2021

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

@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.IO untriaged New issue has not been triaged by the area owner labels Dec 29, 2021
@ghost
Copy link

ghost commented Dec 29, 2021

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

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

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

Author: srxqds
Assignees: -
Labels:

area-System.IO, untriaged

Milestone: -

@lambdageek
Copy link
Member

I don't think we hooked up the ThreadPoolBoundHandle stuff in Mono in 6.0. @lateralusX @steveisok this is probably going to show up in a number of libraries tests on Windows in 7.0

@lambdageek lambdageek added os-windows runtime-mono specific to the Mono runtime labels Dec 30, 2021
@lambdageek lambdageek added this to the 7.0.0 milestone Dec 30, 2021
@marek-safar marek-safar removed the untriaged New issue has not been triaged by the area owner label Dec 30, 2021
@lateralusX
Copy link
Member

lateralusX commented Jan 12, 2022

Probably the same as #34582, so it's a limitation in the portable thread pool used by Mono.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Feb 7, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Mar 4, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Apr 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants