I'm trying to use the default DD4T solution on Google code as a base for my DD4T project and am running into an error "No PageFactory configured"
First things first - I've had to create my own Provider module for Tridion 2013 SP1. I simply copied the DD4T.Providers.SDLTridion2013 project, renamed it, and then built it against the new versions of the CD DLLs.
I reset the supplied global.asax
to inherit the standard HttpApplication
class, and created the Kernel in the NinjectWebCommon.cs
file in the App_Start
folder of my MVC project (.NET 4.5)
My Application_Start()
method in the Global.asax
contains:
protected void Application_Start () {
DependencyInjectionConfig.Configure();
AreaRegistration.RegisterAllAreas();
WebApiConfig.Register(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
and my nInjectWebCommon.cs
file contains
public static class DependencyInjectionConfig
{
public static IKernel Configure()
{
int publicationId = 0;
if (!int.TryParse(ConfigurationManager.AppSettings["DD4T.PublicationId"],
out publicationId))
{
throw new ConfigurationErrorsException("Missing or invalid"
+ " DD4T.PublicationId, please ensure"
+ " this exists in the appSettings element"
+ " in your web.config and contains an integer value");
}
IKernel kernel = new StandardKernel(new DD4TNinjectModule(publicationId));
BindServices(kernel);
return kernel;
}
/// <summary>
/// Bind your own services here
/// </summary>
private static void BindServices(IKernel kernel)
{
// TODO: Inject services for your controllers
}
}
I've set the correct Provider, DD4T PubIDs etc, placed the CD DLLs, config and lib in my /bin folder.
I've set breakpoints in the DD4TNInjectModule.cs
which shows the dependency code is executing, but the code always falls over in DD4T.Mvc.Controllers.TridionControllerBase.GetModelForPage(string PageID)
where PageFactory
is always null...
Am I missing something obvious here?