title: How to resolve error :the type does not appear to implement microsoft.practices.servicelocation.iservicelocator?
body: <p>I am new to MVC, i am following "<strong>PRO ASP.NET MVC 4 by Adam Freeman</strong>". I am currently working on its 6th chapter. In which i am learning how to use <strong>Ninject in MVC 4</strong> for Dependency Injection. I have created the application as described in the book. Now i am not getting why the following Error Comes:</p>
  
  <p><strong>the type does not appear to implement microsoft.practices.servicelocation.iservicelocator</strong></p>
  
  <p>Here is my Controller code:</p>
  
  <pre><code>public class HomeController : Controller
  {
      private Product[] products = {
          new Product {Name = "Kayak", Category = "Watersports", Price = 275M},
          new Product {Name = "Lifejacket", Category = "Watersports", Price = 48.95M},
          new Product {Name = "Soccer ball", Category = "Soccer", Price = 19.50M},
          new Product {Name = "Corner flag", Category = "Soccer", Price = 34.95M}
      };
      private IValueCalculator calc;
      public HomeController(IValueCalculator calcParam)
      {
          calc = calcParam;
      }
      public ActionResult Index()
      {
          ShoppingCart cart = new ShoppingCart(calc) { Products = products };
          decimal totalvalue = cart.CalculateProductTotal();
          return View(totalvalue);
      }
  }
  </code></pre>
  
  <p>I have created a class named as "NinjectDependencyResolver" as below:</p>
  
  <pre><code>public class NinjectDependencyResolver : DependencyResolver
  {
      private IKernel kernal;
  
      public NinjectDependencyResolver()
      {
          kernal = new StandardKernel();
          AddBindings();
      }
  
  
      public object GetService(Type serviceType)
      {
          return kernal.TryGet(serviceType);
      }
  
      public IEnumerable&lt;object&gt; GetServices(Type serviceType)
      {
          return kernal.GetAll(serviceType);
      }
  
      private void AddBindings()
      {
          kernal.Bind&lt;IValueCalculator&gt;().To&lt;LinqValueCalculator&gt;();
      }
  }
  </code></pre>
  
  <p>Changed the global file as below:</p>
  
  <pre><code>public class MvcApplication : System.Web.HttpApplication
  {
      protected void Application_Start()
      {
          AreaRegistration.RegisterAllAreas();
  
          DependencyResolver.SetResolver( new NinjectDependencyResolver());
          WebApiConfig.Register(GlobalConfiguration.Configuration);
          FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
          RouteConfig.RegisterRoutes(RouteTable.Routes);
      }
  }
  </code></pre>
  
  <p>on the "DependencyResolver.SetResolver( new NinjectDependencyResolver());" this line of i am getting the error:</p>
  
  <pre><code>he type EssentialTools.Infrastructure.NinjectDependencyResolver does not appear to implement Microsoft.Practices.ServiceLocation.IServiceLocator.
  </code></pre>
  
  <p>Parameter name: commonServiceLocator</p>
  
  <p>Please help me, how can i resolve this error. </p>
  
  <p>Thanks in advance.</p>