System.IO.FileNotFoundException: 'Could not load file or assembly 'System.IO.FileSystem, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.' #28506
Labels
Milestone
I use a Console app (.Net Target Framework 4.7.2) and imported (via Nuget)
Microsoft.CodeAnalysis.CSharp (version 2.8.2) and
Microsoft.CodeAnalysis.CSharp.Scripting (version 2.8.2)
I then try to run the following simple code:
The following Run-Time error is thrown at
var script = CSharpScript.Create( @"public class Test : ConsoleApp2.IRunnable { public void Run() { System.Console.WriteLine(""test""); } } return typeof(Test); ", ScriptOptions.Default.WithReferences(Assembly.GetExecutingAssembly()));
ERROR:
System.IO.FileNotFoundException: 'Could not load file or assembly 'System.IO.FileSystem, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.'
Inner Exception
FileNotFoundException: Could not load file or assembly 'System.IO.FileSystem, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
What am I doing wrong and how can I fix this run-time error. Do I need some binding redirections? Which and how?
I tried to add to app.config
`
........`
without success...
Thanks
The text was updated successfully, but these errors were encountered: