In writing a Cake addin I have the following:
public static class Aliases
{
[CakeMethodAlias]
public static VaultInfo GetVaultInfo(this ICakeContext context, string userName)
{
Debugger.Launch();
return new VaultInfo("","","","","");
}
}
In my script build.cake
I have:
private static VaultInfo r = GetVaultInfo("user");
When I run this with Cake.exe build.cake
I get
Error: <path>/setup.cake(10,30): error CS0120: An object reference is required for the non-static field, method, or property 'GetVaultInfo(string)'
It sounds like something obviously wrong in the cake script but...!