title: Ninject 3.0 MVC kernel.bind error Auto Registration
body: <p>Getting and error on kernel.Bind(<strong>scanner</strong> => ... 
  "scanner" has the little error line under it in VS 2010.</p>
  
  <blockquote>
    <p>Cannot convert lambda expression to type 'System.Type[]'
    because it is not a delegate
    type  </p>
  </blockquote>
  
  <p>Tyring to Auto Register like the old kernel.scan in 2.0.
  I can not figure out what i am doing wrong. Added and removed so many Ninject packages.
  completely lost, getting to be a big waste of time.</p>
  
  <pre><code>using System;
  using System.Web;
  
  using Microsoft.Web.Infrastructure.DynamicModuleHelper;
  
  using Ninject;
  using Ninject.Web.Common;
  //using Ninject.Extensions.Conventions;
  using Ninject.Web.WebApi;
  using Ninject.Web.Mvc;
  using CommonServiceLocator.NinjectAdapter;
  using System.Reflection;
  using System.IO;
  using LR.Repository;
  using LR.Repository.Interfaces;
  using LR.Service.Interfaces;
  using System.Web.Http;
  
  public static class NinjectWebCommon 
  {
      private static readonly Bootstrapper bootstrapper = new Bootstrapper();
  
      /// &lt;summary&gt;
      /// Starts the application
      /// &lt;/summary&gt;
      public static void Start() 
      {
          DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule));
          DynamicModuleUtility.RegisterModule(typeof(NinjectHttpModule));
          bootstrapper.Initialize(CreateKernel);
      }
  
      /// &lt;summary&gt;
      /// Stops the application.
      /// &lt;/summary&gt;
      public static void Stop()
      {
          bootstrapper.ShutDown();
      }
  
      /// &lt;summary&gt;
      /// Creates the kernel that will manage your application.
      /// &lt;/summary&gt;
      /// &lt;returns&gt;The created kernel.&lt;/returns&gt;
      private static IKernel CreateKernel()
      {
          var kernel = new StandardKernel();
          kernel.Bind&lt;Func&lt;IKernel&gt;&gt;().ToMethod(ctx =&gt; () =&gt; new Bootstrapper().Kernel);
          kernel.Bind&lt;IHttpModule&gt;().To&lt;HttpApplicationInitializationHttpModule&gt;();
  
          RegisterServices(kernel);
          return kernel;
      }
  
  
      /// &lt;summary&gt;
      /// Load your modules or register your services here!
      /// &lt;/summary&gt;
      /// &lt;param name="kernel"&gt;The kernel.&lt;/param&gt;
              private static void RegisterServices(IKernel kernel)
              {
  
                  kernel.Bind(scanner =&gt; scanner.FromAssembliesInPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location))
                      .Select(IsServiceType)
                      .BindToDefaultInterface()
                      .Configure(binding =&gt; binding.InSingletonScope())
                      );
  
              }
  
              private static bool IsServiceType(Type type)
              {
                  // temp return true;
                  // .Any() is not recognized either.
                  return true; // type.IsClass &amp;&amp; type.GetInterfaces().Any(intface =&gt; intface.Name == "I" + type.Name);
              }
  </code></pre>