zzzprojects / Eval-Expression.NET

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

Problems with function overloads #52

Closed lothar7 closed 5 years ago

lothar7 commented 5 years ago

I have the following code in my functionscope that used to work with the free version of your library. After upgrading to the paid version it no longer works.

The problem is that I use function overloading and so these two Max functions will not be detected when compiling the expression.

   public double Max(double var1, double var2, bool ignoreNaNValues) 

   public double Max(double var1, double var2, double var3)

This is a major problem cause we have lots of customers where the expressions have been used and I suddenly have to break compatibility if I want this to work.

lothar7 commented 5 years ago

Turns out its the function names Max, Min, Sum etc that is causing problems. Is there some conflict with linq?

lothar7 commented 5 years ago

Turns out that the following did the trick

EvaluationContext reg = new EvaluationContext(); reg.UnregisterAll();