(Remo beat me to it.)
Microsoft's service locator doesn't really work with MVC's dependency resolver. In fact, when this feature was first being developed, there was plenty of discussion about using service location instead of dependency resolution. Plus, there's issues with Interface Segregation Principle going on here. (Classes shouldn't depend on interfaces they don't use. DR has 2 only methods. CSL has 6. This was quite the hot topic back in the day.)
As for implementation, ServiceLocator.Current.GetInstance(type) throws an exception if the type cannot be resolved. In your case, the specific problem is IControllerFactory instance. My bet is that you didn't wire that up in your kernel bindings. (Nor should you.) DependencyResolver.Current.GetService(type) needs to return null - not throw an exception. When types are not found, especially for IControllerFactory and other MVC-specific implementations, MVC needs to use DefaultControllerFactory, etc.
It's really easy to write your own DR implementation, if you don't want to rely on Ninject.MVC3. It's one class.
public NinjectDependencyResolver : IDependencyResolver
{
private readonly IKernel kernel;
public NinjectDependencyResolver(IKernel kernel)
{
this.kernel = kernel;
}
public virtual object GetService(Type type)
{
return kernel.TryGet(type); // TryGet returns null, Get throws
}
public virutal IEnumerable<object> GetServices(Type type)
{
return kernel.GetAll(type);
}
}
Or, you could wire up all of the MVC-specific stuff inside your Ninject kernel. But that sucks, and exposes you to a lot of work that you don't care about and has nothing to do with your application.