title: Applying aspects to aspects with postsharp
body: <p>I am looking into using post sharp and I am trying to put together a few demos. One of them was an aspect that will log exceptions, and another was to check for null arguments and throw an exception when one is encountered. </p>
  
  <p>The problem I am having is that I want my exception logging aspect to log the exceptions thrown by the null checking aspect. It doesn't seem to be working. Does anybody know of a way to make this work?</p>
  
  <p>EDIT:To be clear, the exception logger is working with exceptions that are thrown outside of an aspect, but isnt logging the exceptions thown on the NullCheckAttribute</p>
  
  <p>The code for the null checking aspect is as follows</p>
  
  <pre><code>[Serializable]
  public class NullCheckAttribute : OnMethodBoundaryAspect
  {
      [ExceptionLogger]
      public override void OnEntry(MethodExecutionArgs args)
      {
          foreach (var argument in args.Arguments)
          {
              if (argument == null)
                  throw new InvalidOperationException("Null argument in " + args.Method.Name);
          }
      }
  }
  </code></pre>
  
  <p>And the code for the exception logger</p>
  
  <pre><code>[Serializable]
  public class ExceptionLoggerAttribute : OnMethodBoundaryAspect
  {
      public override void OnException(MethodExecutionArgs args)
      {
          Console.WriteLine("Exception thrown in " + args.Method.Name);
          Console.WriteLine("***Message: " + args.Exception.Message);
          Console.WriteLine("***Stack trace: " + args.Exception.StackTrace);
      }
  }
  </code></pre>
  
  <p>I should also mention that I am simply using a free licence for this.</p>