title: How do i get ninject 2.0 working with asp.net mvc 2?
body: <p>i am using:-</p>
  
  <ol>
  <li>asp.net mvc rc 2</li>
  <li>Ninject and ninject asp.net mvc extension (<a href="http://github.com/enkari/ninject.web.mvc" rel="nofollow noreferrer">http://github.com/enkari/ninject.web.mvc</a>)</li>
  </ol>
  
  <p>i keep getting the 'No parameterless constructor defined for this object.' for my AccountController. The AccountController is injected with Services. The bindings for these services are defined in the ServiceModule.</p>
  
  <p>Find below the code for my MvcApplication in Global.asax.cs.</p>
  
  <pre><code>public class MvcApplication : NinjectHttpApplication // System.Web.HttpApplication
  {
      public static void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
          routes.MapRoute(
              "Default",                                              // Route name
              "{controller}/{action}/{id}",                           // URL with parameters
              new { controller = "Account", action = "Login", id = "" }  // Parameter defaults
          );
  
      }
  
      protected override void OnApplicationStarted()
      {
          AreaRegistration.RegisterAllAreas();
  
          RegisterRoutes(RouteTable.Routes);
  
          RegisterAllControllersIn(Assembly.GetExecutingAssembly());
      }
  
      protected override IKernel CreateKernel()
      {
          return new StandardKernel(new INinjectModule[] { 
              new ServiceModule(),
          });
      }
  }
  </code></pre>