I have the following RegisterServices function:
private static void RegisterServices(IKernel kernel)
{
kernel.Bind<ISearchRepository>().To<SearchRepository>();
kernel.Bind<ITagRepository>().To<TagRepository>();
kernel.Bind<IStore>().To<Store>()
.WithConstructorArgument("dbId", ConfigurationManager.AppSettings["DatabaseId"])
}
Using breakpoints I can confirm that ConfigurationManager is correctly populating the value.
However, when running I get the following exception when the kernel finishes binding:
If I replace the ConfigurationManager reference with a constant the application runs fine.
I don’t want to lose the ability to configure Ninject through a config file, is this a limitation of Ninject?

No, there is no such limitation of Ninject.
I suppose the problem is that
ConfigurationManager.AppSettings["DatabaseId"]returnsstringand yourdbIdargument is of typeint(or some other non-string type).Try: