views:

62

answers:

3

Can someone direct me to a good example of Unity Dependency Injection for WCF services? Any blog or msdn article will also help.

A: 

To inject dependencies into WCF services I had to implement a service host factory.

I have found a step-by-step tutorial here

onof
Is that the best one? I have already looked at it, and it looks complicated. Anything simpler than that??
SVI
A: 

This answer gives an example on how to enable DI in WCF with Castle Windsor.

Just replace the IWindsorContainer with an IUnityContainer in the example and you should be all set, although you may also want to change the class names from WindsorXyz to UnityXyz :)

Mark Seemann
or you mean just ignore Unity and go with Windsor. You'd be better off altogether.
Krzysztof Koźmic
+1  A: 

I implemented the same following this It worked fine for me.

akash