Question

We need to add a service to our website, I've added the MVC extension and added

Factory="Ninject.Extensions.Wcf.NinjectServiceHostFactory"

To the markup, i've also added

KernelContainer.Kernel = kernel;

To the CreateKernel method to get rid of the root null problem, but now I get

The service type provided could not be loaded as a service because it does not have a default (parameter-less) constructor. To fix the problem, add a default constructor to the type, or pass an instance of the type to the host.

The type in the constructor is binded in the kernel

Thanks

edit: This works

kernel.Bind<ServiceHost>().To<NinjectServiceHost>();
Était-ce utile?

La solution

I recommend using Ninject 3.0.0-rc2 available from Nuget. The new WCF and MVC extensions allow to run side a side.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top