dotnet/roslyn

MethodNotFoundException CSharpScripting.Compile(...)

オープン

#40,983 opened on 2020/01/15

 (0 件のコメント) (0 件のリアクション) (1 人の担当者)C# (4,257 件のフォーク)batch import
Area-InteractiveBugInteractive-ScriptingLogichelp wanted

Repository metrics

Stars
 (20,414 個のスター)
PR merge metrics
 (平均マージ 6d 17h) (30d で 256 merged PRs)

説明

Version Used: 3.4.0

Steps to Reproduce:

    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            try
            {
                // Creating the script
                var compiled = CSharpScript.Create<string>(@"return ""ciao"";");
                compiled.Compile();
                var runner = compiled.CreateDelegate();

                var result = runner().GetAwaiter().GetResult();

                Assert.AreEqual("ciao", result);
            }
            catch (Exception ex)
            {

            }
        }
    }

Expected Behavior: Test pass

Actual Behavior: The test does not run, it compiles but throw at runtime System.MissingMethodException: Method not found: 'System.Collections.Immutable.ImmutableArray1<Microsoft.CodeAnalysis.Diagnostic> Microsoft.CodeAnalysis.Scripting.Script.Compile(System.Threading.CancellationToken)'.`

コントリビューターガイド