Using an IOC container is fine, it’s fitting it into a BCL framework like WCF that’s hard. Finding the Composition Root within all of the deployment options of WCF was daunting, at first. I looked into Ninject.Extensions.Wcf for it’s examples first. It was tough to comprehend because I still didn’t understand where the Ninject kernel was being built, or where the bindings were being defined. So then I looked at the 1-page about Ninject.Extensions.Wcf in Mastering Ninject for Dependency Injection by Daniel Baharestani. Still didn’t really describe what was being overridden so to created the IOC container within the creation of an instance of my web service class. Finally Mark Seeman’s Dependency Injection in .NET comes to the rescue, explaining how one would apply an IOC container of choice to introduce constructor based Poor-Man’s DI into WCF. Everything clicked, went back to the Ninject.Extensions.Wcf examples and proceeded to implement Ninject in all of my deployment scenarios for my current WCF project.

Show your support

Clapping shows how much you appreciated Nick Chamberlain’s story.