Using the NuPack addin and installing the NInject MVC 3 package results in the following compile error in the generated NinjectMVC3.cs
file.
The name MvcServiceLocator does not exist in the current context
The sample video David Ebbo posted shows it working just fine at 09:43.
Here is the currently generated class:
public class NinjectMVC3 {
public static void RegisterServices(IKernel kernel) {
//kernel.Bind<IThingRepository>().To<SqlThingRepository>();
}
public static void SetupDependencyInjection() {
// Create Ninject DI Kernel
IKernel kernel = new StandardKernel();
// Register services with our Ninject DI Container
RegisterServices(kernel);
// Tell ASP.NET MVC 3 to use our Ninject DI Container
MvcServiceLocator.SetCurrent(new NinjectServiceLocator(kernel));
}
}