Following the advice got on another question of mine, I converted the code there quoted to be used with PostSharp:
Attribute:
[Serializable]
public sealed class InitAttribute : OnMethodBoundaryAspect
{
public override void OnEntry(MethodExecutionEventArgs eventArgs)
{
Console.Write("Works!");
}
}
static class Logger
{
public static string _severity;
public static void Init(string severity)
{
_severity = severity;
}
[Init()]
public static void p()
{
Console.WriteLine(_severity);
}
}
Still, I cannot get any result ("Works!" on the console). A breakpoint within the PostSharp attribute reveals that it is never entered.
Any Help? Thanks in advance.