I have been wrapping my head around this and thus far existing questions and answers did not help. So I will try it as well. I am trying to hook up Ninject in Umbraco. What do I have so far:
A class called NinjectWebCommon. This Class was created by NuGet when installing Ninject.
In this class I have added register service like Ninject and NLog document:
[Application("MyApp", "MyApp", "app.gif", 8)]
public class StartupHandler: IApplicationEventHandler
I see that both the code in NinjectWebCommon is run as well as the code in StartupHandler. Yet when I use the following line I get a nullreferenceexception because it can not find the registered service:
Also when I call an action on my controller that has the iLogger injected I receive an error that there is no parameterless constructor. But if I do that my dependency is never injected.
Any thought, starting points, etc for using IoC in Umbraco 6
Using NInject with Umbraco 6.0.5
I have been wrapping my head around this and thus far existing questions and answers did not help. So I will try it as well. I am trying to hook up Ninject in Umbraco. What do I have so far:
A class called NinjectWebCommon. This Class was created by NuGet when installing Ninject.
In this class I have added register service like Ninject and NLog document:
DependencyResolver.Current.GetService<ILogger>().LogInfo("Application Started");
Also when I call an action on my controller that has the iLogger injected I receive an error that there is no parameterless constructor. But if I do that my dependency is never injected.
Any thought, starting points, etc for using IoC in Umbraco 6
is working on a reply...