I have very simple code, which uses nuget Microsoft.CodeAnalysis.CSharp.Scripting:
var script = CSharpScript.Create($@"
IntProp1 = 123;
IntProp2 = 456;
return IntProp1 + IntProp2;
");
var errors = script.Compile();
It was working perfectly fine month ago, now all of a sudden I started receiving exception here:
System.TypeLoadException: 'Method 'CommonCreateArrayTypeSymbol' in type 'Microsoft.CodeAnalysis.CSharp.CSharpCompilation' from assembly 'Microsoft.CodeAnalysis.CSharp, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.'
I figure out that I had mismatched versions of nuget dependencies:
Once I updated "Microsoft.CodeAnalysis.Common" from "3.3.1" to "3.1.0" - everything went back to normal.