Michael D. Green

Blogger, Consultant, Technologist and Very Opinionated.

How to Implement StructureMap 4 in a WCF Service using Nested Containers

10 Feb 2018 » technology

Blogs - Michaeldeongreen

I recently created a proof of concept GitHub repository and GitHub Gist on how to implement StructureMap 4 in a WCF Service using Nested Containers for a client who deals with lots of legacy code. A good portion of the code came from Jimmy Bogard’s blog and he does a great job of explaining the purpose of each class.

I built upon his example to use the latest version of StructureMap, which is currently Version 4 and implemented Nested Containers per Operation Request. The GitHub Repository should be fairly straightforward to follow and I have also created a GitHub Gist to point out the bare minimum classes that I used to accomplish this task.

The GitHub Repository can be found here:
https://github.com/michaeldeongreen/GreenWCF

The GitHub Gist can be found here:
https://gist.github.com/michaeldeongreen/59c01f9b7fe45636b1aa5f946ac0adfb