title: Singleton Scope binding not working as intended
body: <p>I am using the ninject mvc3 plugin with my web api application. I have a binding that looks like:</p>
  
  <p><code>kernel.Bind&lt;IFoo&gt;().To&lt;Foo&gt;().InSingletonScope();</code></p>
  
  <p>It is my interpretation that the kernal will create exactly one instance of <code>Foo</code> and reuse it appropriately. By putting a breakpoint in <code>Foo</code>'s constructor, I can clearly see that it is getting called once per request, and I cannot explain why.</p>
  
  <p>My only guess is that somehow a new kernel is getting created per request, but that doesn't appear to be the case, as the <code>CreateKernel</code> method which sets the global dependency resolver is only getting run once in the application lifetime.</p>
  
  <p>I am using some code taken from <a href="http://www.strathweb.com/2012/05/using-ninject-with-the-latest-asp-net-web-api-source/">this post</a> to make ninject play nice with mvc 4. Because of framework changes, I had to make an additional wrapper that I assign to <code>GlobalConfiguration.Configuration.DependencyResolver</code>:</p>
  
  <pre><code>public class NinjectResolver : NinjectScope, IDependencyResolver
  {
      private readonly IKernel _kernel;
      public NinjectResolver(IKernel kernel)
          : base(kernel)
      {
          _kernel = kernel;
      }
      public IDependencyScope BeginScope()
      {
          return new NinjectScope(_kernel.BeginBlock());
      }
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>