Description
On cmd:
# create file
echo text > file.txt
# create directory symlink to file
mklink /d linktofile file.txt
On .NET:
using System;
using System.IO;
namespace fsw
{
class Program
{
static void Main(string[] args)
{
using var watcher = new FileSystemWatcher("linktofile");
watcher.EnableRaisingEvents = true; // This should've thrown.
Console.WriteLine("Watching...");
Console.ReadKey();
}
}
}
Configuration
.NET 5 and .NET 6 preview
OS: Windows 8.1 or 7.
Windows 10 throws which is what I expected since a directory symlink to a file is a bad symlink.
Regression?
No
Other information
The only problem I see is consistency.
cc @carlossanlop