zzzprojects / Eval-Expression.NET

C# Eval Expression | Evaluate, Compile, and Execute C# code and expression at runtime.
https://eval-expression.net/
Other
449 stars 86 forks source link

Exception when initializing Dictionary<string, object> #119

Closed cesaryuan closed 2 years ago

cesaryuan commented 2 years ago
EvalManager.DefaultContext.Execute(@"new Dictionary<string, object>(){
    {""1"", 1}
}")

Code above throw errors.

InvalidOperationException
--
No method 'Add' on type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]' is compatible with the supplied arguments.
JonathanMagnan commented 2 years ago

Hello @cesaryuan ,

Thank you for reporting, we will look at it.

Best Regards,

Jon

JonathanMagnan commented 2 years ago

Hello @cesaryuan ,

The v4.0.64 has been released.

Could you try it and let us know if the code works correctly now?

Best Regards,

Jon

cesaryuan commented 2 years ago

Thanks for your quick fix! @JonathanMagnan