It seems I'm missing the method LambdaExpression.CompileToMethod
under the namespace System.Linq.Expressions
that exists in the referenced assembly and I cannot understand why.
When I'm including this method in my codebase:
public static void CompileLambdaToMethod(LambdaExpression lambdaExpression, MethodBuilder methodBuilder)
{
lambdaExpression.CompileToMethod(methodBuilder);
}
Visual Studio says the method CompileToMethod
doesn't exists and I get the following error when compiling:
Error CS1061 'LambdaExpression' does not contain a definition for 'CompileToMethod'
I also cannot find the method if I follow the definition of LamdaExpression
in Visual Studio.
The method does exist in the documentation: https://msdn.microsoft.com/en-us/library/dd728258(v=vs.110).aspx
Also, the method exists in the DLL if I inspect the DLL that I'm referencing by following the reference in Visual Studio and opening the abosolute path (at the top inside the #region Assembly
) in dotPeek.
What am I missing?