.NetCore - FileSystemWatcher on a network drive, unsafe code Win32 API crash
Just a quick update, because I'm still on the way to fix it.
I created a MS Support issue. After many try we just succeed to reproduce it. We had to "play" with the network and simulating some "disturbances". It seems that FileSystemWatcher events didn't been sent as it should be (It's sent by TCP protocol, SMB way). Our team is still working on finding how it can happen..
MS agreed that this shouldn't crash the FileSystemWatcher in some unsafe code no matter if there was a real network issue. So, they just made a PR to add some security around it.
I'm still following the PR but it should be fix in .Net 5 and backported in .Net Core 3.1(.9).
Thanks for the help.