title: Adding an OnException attribute using PostSharp
body: <p>I am adventuring into some AOP and it seems with .NET PostSharp is the way to go. </p>
  
  <p>I want to do some simple logging to the db when an exception occurs. However I am finding it difficult to find any real solid examples of using PostSharp beyond the basics. I tried the following:</p>
  
  <pre><code>[Serializable]
  public sealed class LogExceptionAttribute : ExceptionHandlerAspect
  {
      public override void OnException(MethodExecutionEventArgs eventArgs)
      {
          //do some logging here
      }
  }
  </code></pre>
  
  <p>And then attaching a <code>[LogException]</code> attribute to a method</p>
  
  <p>But I get a compile error:</p>
  
  <pre><code>Error   7   The type "CoDrivrBeta1.Classes.LogExceptionAttribute" or one of its ancestor should be decorated by an instance of MulticastAttributeUsageAttribute.    C:\work\CoDrivrBeta1\CoDrivrBeta1\EXEC  CoDrivrBeta1
  </code></pre>
  
  <p>I have to confess I am very new to this, but it seems like an interesting concept, I think i just need to be pointed in the right direction</p>