I'm using SimpleInjector and I get the following error when I try to call SimpleInjectorServiceHostFactory-->CreateServiceHost(Type serviceType, Uri[] baseAddresses). This error appear only for the WCF services marked as [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)].
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.
For the services marked as [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] the SimpleInjectorServiceHostFactory-->CreateServiceHost(Type serviceType, Uri[] baseAddresses) method works perfectly even if the service doesn't have a default parameter-less constructor.
Any idea how to have an injection of the parameters for [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)] services just like it happens with [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] services without the default parameter-less constructor ?
Thanks