Hi
I am following below API document ( using kentico v8.1)
https://docs.kentico.com/display/K8/Registering+custom+macro+methods
to create macro but getting reference error when I tried to register class.
[assembly: RegisterExtension(typeof(CustomMacroMethods), typeof(string))] [assembly: RegisterExtension(typeof(CustomMacroMethods), typeof(StringNamespace))]
Error : "The type or namespace could not be found (are you missing using a directive or an assembly reference?"
Even I have added all below reference.
using CMS.Base; using CMS.MacroEngine; using CMS.Helpers;
using CMS.GlobalHelper; using CMS.Compatibility; using CMS.SettingsProvider; using CMS.DataEngine; using CMS.SiteProvider; using CMS.CMSHelper; using CMS.Scheduler; using CMS.EventLog; using CMS.DocumentEngine;
Please help ?
Thanks
Post your code for the namespace and class structure.
Thanks for response.
I have added simple method in that class-
public static string MyMethod(string param1) { return param1; }
The first line should match your namespace and class. Like this:
[assembly: RegisterCustomClass("BP.SendEventReminder", typeof(SendEventReminder.SendEventReminderTask))] namespace SendEventReminder { public class SendEventReminderTask { //code
Please, sign in to be able to submit a new answer.