If you are using StructureMap with MVC3, please read this:

Ok, a couple people are stumbling into some problems with using StructureMap with ASP.Net MVC3′s new IoC integration. Steve Smith has a blog post here that shows a correctly working version of using StructureMap as MVC3′s IDependencyResolver.

The specific problem is in the IDependencyResolver.GetService(type) method. MVC3 makes a different set of assumptions about IoC functionality than we did with StructureMap’s TryGetInstance(type) method.

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 http://codebetter.com/jeremymiller.
This entry was posted in StructureMap and tagged . Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • http://twitter.com/PostHopeLive Paul Barton

    Can you take a look at the Structuremap-MVC3 nuget package and make sure there are no problems with the configuration?

  • Steven Gentile

    Thanks for the heads up!