oleg-shilo / cs-script.core

.NET Core port of CS-Script
MIT License
100 stars 18 forks source link

Constructor on type 'css_root+Script' not found. #11

Closed MetSystem closed 4 years ago

MetSystem commented 4 years ago

version: 1.3.1 dotnet: net core 3.1

CSScript.RoslynEvaluator
//                    .LoadCode(@"using System;
//public class Script
//{
//    public int Sum(int a, int b)
//    {
//        Console.WriteLine(a+b);
//        return a+b;
//    }
//}");
 .LoadFile("SumScript.cs", string.Empty);  

SumScript.cs:

using System;
public class Script
{
    public int Sum(int a, int b)
    {
        Console.WriteLine(a+b);
        return a+b;
    }
}

result: success: LoadCode fail: LoadFile

MetSystem commented 4 years ago
.LoadFile("SumScript.cs", null);