Simple question I guess, but I\'ve spent an hour trying to get a base class for my controllers to have a few services injected via property injection. The properties were s
Pretty sure the InjectNonPublic
flag on the NinjectSettings
allows you to configure it to do what you want - closest link I can find quickly
Whether it's going to be supported for any significant length of time, I don't know - injecting privates is just a bad idea (along with Property Injection and associated scoundrels :P)
You cannot inject into properties that do not have public setter. Both your Logger and Repository properties are protected so no way for Ninject to assign them a value. You will have to change their setter visibility if you want to achieve this. Or use constructor injection. While this would make perfect sense for the repository property which seems required it wouldn't make sense for the logger property. So I guess you will have to make it public.