Hello
I have following custom Macro method setup
Macro
[MacroMethod(typeof(bool), "Comment ", 2)] [MacroMethodParam(0, "id", typeof(int), "Comment")] [MacroMethodParam(1, "number", typeof(int), "Comment")] public static object Method(EvaluationContext context, params object[] parameters) { // Method }
When I run the Macro, I'm getting following error: Method for object of type 'System.Int32' not found, please check the macro or the method declaration.
Method for object of type 'System.Int32' not found, please check the macro or the method declaration.
Is there something wrong in my setup?
Kind regards
Kenny
I've found the solution.
Calling Method(ToInt(123),456) did fix the issue.
Method(ToInt(123),456)
I assume you've followed the docs: docs.kentico.com/.../registering-custom-macro-methods
Have you also registered them?
And the code us supplied your macro will be called literally as Method(123,456), as I expect you want something as GetComment(123,456)?
Method(123,456)
GetComment(123,456)
Hi David
I've registered my MacroMethodContainer as
MacroMethodContainer
[assembly: RegisterExtension(typeof(CustomMacroMethods), typeof(int))]
I've been following the documentation.
The Container is places in another project.
Please, sign in to be able to submit a new answer.