question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TargetParameterCountException when rendering ValueKind or JObject

See original GitHub issue

Hi,

Latest Scriban, this is my test code to illustrate the issue.

I’m actually doing something else, but this is the same error.

static void Main(string[] args)
        {
            var input = JObject.Parse("{\"name\":\"steve\"}");
            var template = Scriban.Template.Parse("Hi {{name}}");
            var result = template.Render(input);
            Console.WriteLine(result);
        }

I get this:

System.Reflection.TargetParameterCountException: ‘Parameter count mismatch.’

Am I doing something wrong here?

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
evolvedlightcommented, Jan 21, 2021

@NeilMacMullen something different actually (templating in office files), but I was just looking at Textrude now, I can see other uses for it!

0reactions
NeilMacMullencommented, Jan 21, 2021

@evolvedlight Not sure if you are trying to do the templating dynamically at runtime but for a static/compile time solution you can use my project https://github.com/NeilMacMullen/Textrude which does the model conversion for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - TargetParameterCountException when enumerating ...
In this case, one of the string's properties is the indexer for returning the character at the specified location. Thus, when you try...
Read more >
TargetParameterCountException Class (System.Reflection)
The exception that is thrown when the number of parameters for an invocation does not match the number expected. This class cannot be...
Read more >
Asynchronous workflows
All parallelism is cooperative as the JavaScript runtime is single-threaded. You have to yield control inside a workflow to let other workflows execute....
Read more >
Patch Notes for Odin Inspector and Serializer v2.0.16
Fixed an issue with the InfoBox attribute where referencing an instance method with a parameter would throw a TargetParameterCountException.
Read more >
Client-side vs Server-side
Math in WebSharper; Rendering expressions ... TargetException; TargetInvocationException; TargetParameterCountException ... Parameters; SerializeMacro.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found