-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot compile template with Lookup helper - signature or security transparency is not compatible #268
Comments
A few others have reported encountering this exception, but I've been unable to reproduce it. Can you share your declaration of the |
Hello rexm, Thank you for your reply! In the documentation (https://handlebarsjs.com/builtin_helpers.html) I saw that the lookup helper was listed as a built-in helper, so I assumed it would work out of the box. So probably that's my mistake and I will have a look at declaring it myself. |
Handlebarsjs is the complete original implementation. The goal of this project is to achieve parity in .NET and while we are about 90% of the way there, a few features remain. The lookup helper is one of those.
…Sent from my iPhone
On Sep 27, 2018, at 11:29, Erik Rans ***@***.***> wrote:
Hello rexm, Thank you for your reply!
In the documentation (https://handlebarsjs.com/builtin_helpers.html) I saw that the lookup helper was listed as a built-in helper, so I assumed it would work out of the box.
So probably that's my mistake and I will have a look at declaring it myself.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Aah ok, that makes sense now. Sorry for the confusion, and I'll close the issue. |
Hello,
I'm trying to use the following template (TestTemplate) in a console application using .NET Core 2.1 and Handlebars.Net 1.9.5
So the line with {{ > (lookup TemplateName)}} is causing me problems
The idea is to use a partial, where the partial name will be resolved later by passing the TemplateName variable.
However, when I try to compile the template by using
I get the following exception :
System.ArgumentException: Cannot bind to the target method because its signature or security transparency is not compatible with that of the delegate type.
at System.Reflection.RuntimeMethodInfo.CreateDelegateInternal(Type delegateType, Object firstArgument, DelegateBindingFlags bindingFlags)
at HandlebarsDotNet.Compiler.SubExpressionVisitor.GetHelperDelegateFromMethodCallExpression(MethodCallExpression helperCall)
at HandlebarsDotNet.Compiler.SubExpressionVisitor.VisitSubExpression(SubExpressionExpression subex)
at System.Linq.Expressions.ExpressionVisitor.VisitUnary(UnaryExpression node)
at System.Linq.Expressions.UnaryExpression.Accept(ExpressionVisitor visitor)
at System.Dynamic.Utils.ExpressionVisitorUtils.VisitArguments(ExpressionVisitor visitor, IArgumentProvider nodes)
at System.Linq.Expressions.ExpressionVisitor.VisitMethodCall(MethodCallExpression node)
at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor)
at System.Linq.Expressions.ExpressionVisitor.VisitUnary(UnaryExpression node)
at System.Linq.Expressions.UnaryExpression.Accept(ExpressionVisitor visitor)
at System.Linq.Expressions.ExpressionVisitor.VisitConditional(ConditionalExpression node)
at System.Linq.Expressions.ConditionalExpression.Accept(ExpressionVisitor visitor)
at System.Dynamic.Utils.ExpressionVisitorUtils.VisitBlockExpressions(ExpressionVisitor visitor, BlockExpression block)
at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression node)
at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor visitor)
at HandlebarsDotNet.Compiler.FunctionBuilder.Compile(IEnumerable
1 expressions, Expression parentContext, String templatePath) --- End of inner exception stack trace --- at HandlebarsDotNet.Compiler.FunctionBuilder.Compile(IEnumerable
1 expressions, Expression parentContext, String templatePath)at HandlebarsDotNet.Compiler.FunctionBuilder.Compile(IEnumerable
1 expressions, String templatePath) --- End of inner exception stack trace --- at HandlebarsDotNet.Compiler.FunctionBuilder.Compile(IEnumerable
1 expressions, String templatePath)at HandlebarsDotNet.Handlebars.HandlebarsEnvironment.Compile(String template)
I hope someone has an idea, because I've already been searching quite some time.
The text was updated successfully, but these errors were encountered: