StructureMap 2.5.2 is Released

I just released StructureMap 2.5.2 on SourceForge.  You can download it here.  This release contains some new features:

  1. The IContainer is always injected into the Container itself.  This means that you can expect a constructor argument of type “IContainer” to be filled with the current Container.  This does work with ObjectFactory
  2. “Missing Instance” handler.  If you ask for an Instance by name that does not exist, Missing Instance gets a chance to handle the request
  3. Conditional Construction – I’ve gotten a lot of questions about “I want to do this if the user has this role, and this if he doesn’t” type of scenarios.  The Conditional Instance feature bakes this into StructureMap out of the box
  4. Convention based Setter Injection Policies.  Specify rules like “I want all public setter properties where the PropertyType is in this namespace to be injected by StructureMap”
  5. New functionality in IContext / BuildSession (TryGetInstance<T>() and GetInstance<T>(name))
  6. The BuildUp() functionality to inject dependencies through public setters of an existing object for usage in ASP.Net WebForms and other environments that do not allow you to control object creation
  7. Convenience methods for requesting open generic types
  8. Minor improvements to the Assembly Scanning.  Easier ways to create auto registration policies.
  9. Interception techniques can now use the IContext during construction

There is one breaking change, the InstanceInterceptor interface was changed to include an IContext argument to its Process() method:


    public interface InstanceInterceptor


        object Process(object target, IContext context);



I’ll be blogging examples of the new features in the next week.  Starting on Monday, there will be at least one new StructureMap tip posted every day until the end of January.



What’s Next?

I didn’t get everything into this release that I wanted to, and I’m behind in some promises.  I start the next (2.5.3) release tomorrow night.  In order of priority, the upcoming release(es) will contain:

  • Prism Bootstrapper (2.5.3)
  • Improved Diagnostic Messages
  • A Reference Common Service Locator
  • Samples, Samples, Samples!
  • Silverlight Version
  • Medium Trust Enhancements
  • Compact Framework Version

I’m hoping to get the Prism Bootstrapper out this week, and the rest by the end of January. 


Where Has it Been?

Mostly out of self reflection, I thought I’d throw together a timeline for StructureMap.

  1. Summer ‘02 – I was a non-coding architect with no .Net or J2EE delivery experience, and I was scared.  I plotted a plan to build the world’s greatest ORM in order to build up some credibility to find another job where I could code.  I explained it to my then wife and she named it “StructureMap.”  The name made a lot more sense back then 😉
  2. Christmas ‘02 – StructureMap coding begins
  3. Summer ‘03 – I was traveling for ThoughtWorks and away from the family a lot.  At nights I was working on the configuration subsystem for my grand vision.  I ran out of energy and mothballed it.
  4. January ‘04 – I started reading about PicoContainer in the Java world and thought to myself, “that configuration subsystem code could be morphed into this IoC/DI tool thingie.”
  5. Early Spring ‘04 – What became StructureMap quickly took shape at nights and on the plane trips back and forth between Chicago O’Hare and Austin.
  6. June 9, 2004 – Version 0.80 was released on SourceForge.  StructureMap had been used in a production system shortly before the OSS release. Xml in, objects out.  You could use attributes out the wazoo too.
  7. Jan 15, 2005 – Version 0.90 was released.  Fancier ways to take Xml in, and spit out objects.  I added setter injection for the first time.  My first attempt at improved diagnostics.
  8. May 5, 2006 – Version 1.0 was released.  Crazy ways to take Xml in, and spit out objects.  More diagnostic tools and some NAnt tasks that have since been quietly excised
  9. April 2, 2007 – Version 2.0 was released.  The first version of what is now the Registry DSL.  I cut my teeth on Fluent Interfaces on this release.  Supported open generics for the first time.
  10. Fall ‘07 through Fall ‘08 – StructureMap was effectively gutted and largely re-architected.  It hurt, but I learned a lot and the architecture is vastly easier to extend now. 
  11. June 23, 2008 – Version 2.4.9 was released as a compromise
  12. Summer ‘08 – Jimmy Bogard openly mocks me at every turn by calling the forthcoming 2.5 release the “Duke Nukem Forever” release
  13. Oct 27, 2008 – StructureMap 2.5 follows closely on the heals of “Chinese Democracy.”  I describe 2.5 as the “Python 3000” release
  14. Dec 12, 2008 – Version 2.5.1 is released as a bit of a Merry Christmas present with some bug fixes that built up from the 2.5 release
  15. Jan 11, 2008 – Version 2.5.2 is released with some new functionality that builds on the 2.5 architecture.

About Jeremy Miller

Jeremy is the Chief Software Architect at Dovetail Software, the coolest ISV in Austin. Jeremy began his IT career writing "Shadow IT" applications to automate his engineering documentation, then wandered into software development because it looked like more fun. Jeremy is the author of the open source StructureMap tool for Dependency Injection with .Net, StoryTeller for supercharged acceptance testing in .Net, and one of the principal developers behind FubuMVC. Jeremy's thoughts on all things software can be found at The Shade Tree Developer at
This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • Glenn Block

    Nice job Jeremy! I really need to play with SM one of these days. Next time we see each other let’s pair 1 hr on MEF, 1 hr on SM. :-)

    BTW, I like the new injecting the container in the container featuree 😉

  • http://www.Marisic.Net Chris Marisic


    I’m not familiar with Prism / what a bootstrapper would do for it, could you give me a link point me in the right direction on this?

  • jam

    Thanks for all your hard work. I am beginning to learn more about all the best practices for architecture, IoC, loose coupling, high cohesion, SOC etc. and it has been made fun and easy to learn these because of people like you who come up with great tools and framework like structure map to make the experience of learning and applying these principles to working projects. And more importantly share it with the community. Great work.

    Just a small suggested correction for the “Where Has it Been?” section for point 15. The year should be 2009 instead of Jan 11, 2008 :). Just pointing out as looking at the chronological evolution of the Structure Map is an inspiration to do something good for others.

  • Claudio Lassala

    Looking forward for the Prism bootstrapper!

  • Eric Lee

    Thanks for all your work on this. I’m using StructureMap on a real project for the first time and wow, IoC containers are awesome! They get rid of SO MUCH pain!

  • Arkadiusz Waśniewski

    .NET Compact Framework. Hm… I think it will be very hard to get really good performance especially using reflection. But I hope You will… :-)

  • Stu Campbell

    Jeremy, thanks for all your hard work and being so responsive on the mailing list. I’m still an SM noob but really liking it so far.

  • Derik Whittaker

    Congrats man, nice work

  • Daniel Lidström

    I want to thank you for wanting to support Compact Framework. There’s not a lot to choose from when targeting CF. I am definitely looking forward to StructureMap CF! :-)

  • scott

    Impressive. Not SM (well, that too) but the tenacity. I knew the path colloquially just from knowing you, but seeing it laid out there like that with dates and all really nails down the weight of the project and just how much of yourself you’ve given to the community. You will never have to buy your own beer when I’m around 😉