Li Tian Gong
Li Tian Gong

Reputation: 393

Ninject 2.2 can't support WCF with InstanceContextMode.Single

I have a WCF service with InstanceContextMode set to single

then Ninject 2.2 can not support it.

and Ninject 2.3 is still beta, if I use it, my Ninject 2.2 code in global.asax can't work with Ninject 2.3 library

Can anyone/Ninject Author give an example on using Ninject 2.3?

Or should I switch to other IoC?

[Edit] forgot to say. I don't have a default constructor for my service class, and so it will result in this error:

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.

Upvotes: 2

Views: 570

Answers (1)

Remo Gloor
Remo Gloor

Reputation: 32725

Ninject 2.2 supports single instance services. Have a look at the examples on github: https://github.com/ninject/ninject.extensions.wcf/tree/Maintenance_2.2/src/Examples

Upvotes: 2

Related Questions