I'm installing the ninject package , but the NinjectWebCommon class is not automatically created in the App_Start folder.
Does anyone have a solution? I'm installing the Ninject.MVC5 version.
I'm installing the ninject package , but the NinjectWebCommon class is not automatically created in the App_Start folder.
Does anyone have a solution? I'm installing the Ninject.MVC5 version.
The latest version of Ninject.MVC5. Changed and no longer create NinjectWebCommon
in App_Start
, instead you have to change the Global.asax.cs
file by inheriting NinjectHttpApplication
.
public class MvcApplication : NinjectHttpApplication
{
protected override void OnApplicationStarted()
{
base.OnApplicationStarted();
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
AutoMapperConfig.RegisterMappings();
}
protected override IKernel CreateKernel()
{
var modules = new NinjectModule[] { new ModulosNinject() };
return new StandardKernel(modules);
}
}