You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to upgrade from Linq.Dynamic.Core 1.2.25 to 1.3.3 and facing runtime ParserExcpetions on DynamicExpressionParser.ParseLambda call No applicable method 'SomeMethod' exists in type 'MyCustomType'.
I've read the note on breaking change from 1.3.0 about having to register any classes from which a method should be callable (tested both ways with an attribute and a custom type provider), but that is not the problem (otherwise a Methods on type 'MyCustomType' are not accessible would have been thrown).
2. Exception
Exception from the first fiddle:
No applicable method 'GetSomeValue' exists in type 'MyCustomClass' (at index 14)
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseMemberAccess(Type type, Expression expression) in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 1753
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseTypeAccess(Type type, Boolean getNext) in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 1661
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseIdentifier() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 941
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParsePrimaryStart() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 817
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParsePrimary() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 785
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseUnary() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 780
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseMultiplicative() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 725
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseAdditive() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 692
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseShiftOperator() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 668
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseComparisonOperator() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 456
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseLogicalAndOrOperator() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 388
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseIn() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 299
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseAndOperator() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 282
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseOrOperator() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 264
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseLambdaOperator() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 244
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseNullCoalescingOperator() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 231
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseConditionalOperator() in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 215
at System.Linq.Dynamic.Core.Parser.ExpressionParser.Parse(Type resultType, Boolean createParameterCtor) in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:line 153
at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(Type delegateType, ParsingConfig parsingConfig, Boolean createParameterCtor, ParameterExpression[] parameters, Type resultType, String expression, Object[] values) in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\DynamicExpressionParser.cs:line 121
at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(ParsingConfig parsingConfig, Boolean createParameterCtor, ParameterExpression[] parameters, Type resultType, String expression, Object[] values) in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\DynamicExpressionParser.cs:line 98
at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(ParameterExpression[] parameters, Type resultType, String expression, Object[] values) in C:\Dev\GitHub\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\DynamicExpressionParser.cs:line 392
If one adds the DynamicLinqType() Attribute on MyCustomClass in the second fiddle, a similar exception is thrown, so this probably has something to do with handling member access in custom types in general.
(i would have digged deeper to find the root cause, but could not download symbol files from nuget server, so debugging inside DynamicLinq.Core was not possible)
Thanks for any help on this
The text was updated successfully, but these errors were encountered:
jhpetersen
changed the title
params array in custom type method raises "No applicable method '' exists in type ''" ParseException
method call in custom type method raises "No applicable method '' exists in type ''" ParseException
Jul 7, 2023
jhpetersen
changed the title
method call in custom type method raises "No applicable method '' exists in type ''" ParseException
method call in custom type raises "No applicable method '' exists in type ''" ParseException
Jul 7, 2023
Wow, thanks, i would never have suspected that to be the cause 😮 👍
I modified the parameter name as a trial and it worked:
var multipleParamsExpression = $"FooBar.{nameof(MyCustomClass.GetSomeValue)}(input)";
var multipleParamsExpressionParams = new ParameterExpression[] {
Expression.Parameter(typeof(MyCustomClass), "FooBar"),
Expression.Parameter(typeof(int), "input")
};
(Nevertheless should be fixed or well documented..)
StefH
changed the title
method call in custom type raises "No applicable method '' exists in type ''" ParseException
Doc: Method call in custom type raises "No applicable method '' exists in type ''" ParseException
Sep 10, 2023
1. Description
I am trying to upgrade from Linq.Dynamic.Core 1.2.25 to 1.3.3 and facing runtime ParserExcpetions on DynamicExpressionParser.ParseLambda call
No applicable method 'SomeMethod' exists in type 'MyCustomType'
.I've read the note on breaking change from 1.3.0 about having to register any classes from which a method should be callable (tested both ways with an attribute and a custom type provider), but that is not the problem (otherwise a
Methods on type 'MyCustomType' are not accessible
would have been thrown).2. Exception
Exception from the first fiddle:
3. Fiddle or Project
I created two test fiddles:
one demonstrating the issue with 1.3.3 and a second working with 1.2.25
4. Any further technical details
If one adds the DynamicLinqType() Attribute on MyCustomClass in the second fiddle, a similar exception is thrown, so this probably has something to do with handling member access in custom types in general.
(i would have digged deeper to find the root cause, but could not download symbol files from nuget server, so debugging inside DynamicLinq.Core was not possible)
Thanks for any help on this
The text was updated successfully, but these errors were encountered: