I have these lines in NinjectControllerFactory:
private void AddBindings()
{
ninjectKernel.Bind<IDatabaseFactory>().To<DatabaseFactory>();
ninjectKernel.Bind<IArticleRepository>().To<ArticleRepository>();
ninjectKernel.Bind<IMatchXMLRepository>().To<MatchXMLRepository>();
}
I added Admin area and controller to this area too. I want to matches should be visible just in Admin area. When I try /Matches/ it´s working (when controller is out of area) but when I try /Admin/Matches I get this error:
The IControllerFactory 'SkMoravanSvitavka.Infrastructure.NinjectControllerFactory' did not return a controller for the name 'Matches'.
How could I change binding to get url with area? Thanks
Try using the Ninject.MVC3 extension instead of using your own ConrtollerFactory. Many people report problems with areas when using custom implementations.