title: Couldn't get Ninject-Interception via Attributes to work, what did I do wrong?
body: <p>I'm trying build out our logging framework using EntLib Logging and use attribute to indicate which class/method should be logged.  So I think Interception would be a good choice.  I'm a super noob to Ninject and Interception and I's following the tutorial at <a href="http://innovatian.com/2010/03/using-ninject-extensions-interception-part-2-working-with-interceptors/" rel="nofollow">Innovatian Software</a> on how to use interception via attributes.  But when I run the app, BeforeInvoke and AfterInvoke was never called.  Help Please, Thank You!</p>
  
  <pre><code>using System;
  
  using System.Diagnostics;
  
  using System.Collections.Generic;
  
  using Castle.Core;
  
  using Ninject;
  
  using Ninject.Extensions.Interception;
  
  using Ninject.Extensions.Interception.Attributes;
  
  using Ninject.Extensions.Interception.Request;
  
      class Program
      {
          static void Main(string[] args)
          {
              var kernel = new StandardKernel();
              kernel.Bind&lt;ObjectWithMethodInterceptor&gt;().ToSelf(); 
  
              var test= kernel.Get&lt;ObjectWithMethodInterceptor&gt;();
              test.Foo();
              test.Bar();
              Console.ReadLine();
          }
      }
  
      public class TraceLogAttribute : InterceptAttribute
      {
          public override IInterceptor CreateInterceptor(IProxyRequest request)
          {
              return request.Context.Kernel.Get&lt;TimingInterceptor&gt;();
          }
      }
  
      public class TimingInterceptor : SimpleInterceptor
      {
          readonly Stopwatch _stopwatch = new Stopwatch();
          protected override void BeforeInvoke(IInvocation invocation)
          {
              Console.WriteLine("Before Invoke");
              _stopwatch.Start();
          }
          protected override void AfterInvoke(IInvocation invocation)
          {
              Console.WriteLine("After Invoke");
              _stopwatch.Stop();
              string message = string.Format("Execution of {0} took {1}.",
                                              invocation.Request.Method,
                                              _stopwatch.Elapsed);
              Console.WriteLine(message);
              _stopwatch.Reset();
          }
      }
  
      public class ObjectWithMethodInterceptor
      {
          [TraceLog] // intercepted
          public virtual void Foo()
          {
              Console.WriteLine("Foo - User Code");
          }
          // not intercepted
          public virtual void Bar()
          {
              Console.WriteLine("Bar - User Code");
          }
      }
  </code></pre>