I'm trying to use FileSystemWatcher class in coreclr project on Ubuntu but I'm getting following exception:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.IO.FileSystem.Watcher, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
my project.json file:
{
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.Runtime": "1.0.1-beta-*",
"System.IO": "4.0.11-beta-*",
"System.IO.FileSystem.Watcher": "4.0.0-beta-*",
"System.Console": "4.0.0-beta-*",
"System.Runtime": "4.0.21-beta-*"
},
"frameworks": {
"dnxcore50": { }
}
}
and Program.cs:
using System;
using System.IO;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
using (var watcher = new FileSystemWatcher("."))
{
Console.WriteLine("Watcher created!");
}
}
}
}
What am I doing wrong?
PS. .NET Core installed according to instructions from this site: https://dotnet.github.io/getting-started/
dnu restorein directory, does it succeed? - Pavel Krymets-betaversion part in your dependencies to be"4.0.0-*etc. - Pavel Krymets