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
Finalizer crashes because of FileSystemWatcher Dispose exception in FileSystemWatcher_mobile.cs #7338
Could be nice that FileSystemWatcher.Dispose did not throw exceptions, since it is already protected by FileSystemWatcher-constructor throwing NotImplementedException .
Strange that Finalizer-thread runs naked, and can take down the entire application if cleaning up an object that has a bad Dispose-method.
Current Behavior
Crashes with unhandled exception:
Unhandled Exception: System.NotImplementedException: The method or operation is not implemented. at System.IO.FileSystemWatcher.Dispose (System.Boolean disposing) [0x00000] in /Library/Frameworks/Xamarin.Mac.framework/Versions/4.0.0.216/src/mono/mcs/class/System/System.IO/FileSystemWatcher_mobile.cs:62
at System.ComponentModel.Component.Finalize () [0x00000] in /Library/Frameworks/Xamarin.Mac.framework/Versions/4.0.0.216/src/mono/mcs/class/referencesource/System/compmod/system/componentmodel/Component.cs:35
Expected Behavior
Doesn't crash
On which platforms did you notice this
[ x] macOS
[ ] Linux
[ ] Windows
Version Used:
Xamarin.Mac.framework/Versions/4.0.0.216
Stacktrace
Unhandled Exception: System.NotImplementedException: The method or operation is not implemented. at System.IO.FileSystemWatcher.Dispose (System.Boolean disposing) [0x00000] in /Library/Frameworks/Xamarin.Mac.framework/Versions/4.0.0.216/src/mono/mcs/class/System/System.IO/FileSystemWatcher_mobile.cs:62
at System.ComponentModel.Component.Finalize () [0x00000] in /Library/Frameworks/Xamarin.Mac.framework/Versions/4.0.0.216/src/mono/mcs/class/referencesource/System/compmod/system/componentmodel/Component.cs:35
changed the title [-]Finalizer crashes because of FileSystemWatcher Dispose[/-][+]Finalizer crashes because of FileSystemWatcher Dispose in NetStandard[/+]on Feb 28, 2018
changed the title [-]Finalizer crashes because of FileSystemWatcher Dispose in NetStandard[/-][+]Finalizer crashes because of FileSystemWatcher Dispose exception in FileSystemWatcher_mobile.cs[/+]on Feb 28, 2018
I ran into the same problem today with an app which was previously working. I was able to work around this by deriving from the FileSystemWatcher and override the Dispose method:
Activity
[-]Finalizer crashes because of FileSystemWatcher Dispose[/-][+]Finalizer crashes because of FileSystemWatcher Dispose in NetStandard[/+][-]Finalizer crashes because of FileSystemWatcher Dispose in NetStandard[/-][+]Finalizer crashes because of FileSystemWatcher Dispose exception in FileSystemWatcher_mobile.cs[/+]akoeplinger commentedon Feb 28, 2018
I agree we should remove the exception from Dispose().
@marek-safar any thoughts on enabling FSW for Xamarin.Mac?
Don't throw NotImplementedException in Dispose()
Don't throw NotImplementedException in Dispose()
Don't throw NotImplementedException in Dispose()
Don't throw NotImplementedException in Dispose()
marek-safar commentedon Mar 1, 2018
We should have FSW everywhere as it's included in netstandard
akoeplinger commentedon Mar 1, 2018
Filed #7371 for tracking enabling FSW on more platforms.
Don't throw NotImplementedException in Dispose()
Bump to mono/2017-12/15d76bf5
Bump to mono/2017-12/15d76bf5 (#1377)
Bump to mono/2017-12/15d76bf5 (#1377)
ArgusMagnus commentedon Mar 22, 2018
I ran into the same problem today with an app which was previously working. I was able to work around this by deriving from the FileSystemWatcher and override the Dispose method:
Bump to mono/2018-02/0c5a524e (#1289)
Bump to mono/mono:2018-04@f3a2216b (#1503)
Bump to mono/mono:2018-04@f3a2216b (#1503)