Hi,

I am new to Spring.NET and I am evaluating Spring.NET for several of my projects and running into an issue with the Spring.Expressions library with regard to the Lambda Expressions discussed in section 11.3.15 of the manual. I am on the latest version 1.3.1 of Spring.NET.

I am trying the following from page #117 of the manual as is which is not working:

IDictionary vars = new Hashtable();

Expression.RegisterFunction("sqrt", "{|n| Math.Sqrt($n)}", vars);

ExpressionEvaluator.GetValue(null, "#sqrt(9)", vars) // 3

After successful compilation when I run my application, I get the following runtime error on Math.Sqrt call:

My guess is that Spring.Core is not able to find the .NET System.Math library.

What am I doing wrong here and how can I fix this issue?

Thanks,

Faisal

I am new to Spring.NET and I am evaluating Spring.NET for several of my projects and running into an issue with the Spring.Expressions library with regard to the Lambda Expressions discussed in section 11.3.15 of the manual. I am on the latest version 1.3.1 of Spring.NET.

I am trying the following from page #117 of the manual as is which is not working:

IDictionary vars = new Hashtable();

Expression.RegisterFunction("sqrt", "{|n| Math.Sqrt($n)}", vars);

ExpressionEvaluator.GetValue(null, "#sqrt(9)", vars) // 3

After successful compilation when I run my application, I get the following runtime error on Math.Sqrt call:

**An unhandled exception of type 'Spring.Core.NullValueInNestedPathException' occurred in Spring.Core.dll**

Additional information: Cannot initialize property or field node 'Math' because the specified context is null.Additional information: Cannot initialize property or field node 'Math' because the specified context is null.

My guess is that Spring.Core is not able to find the .NET System.Math library.

What am I doing wrong here and how can I fix this issue?

Thanks,

Faisal

## Comment