Getting StructureMap to Work with MVC4 RC and Web API

At the moment (18 July 2012) if you install the NuGet package structuremap.MVC4, it will not compile due to breaking changes in the ASP.NET MVC4 RC distribution. You have to jump through some extra hoops to get this working. Here are two posts that help:

However, even with both of these getting things working wasn’t quite as easy as I would have liked. Here are two full files with namespaces showing what I used to get things working (Gist 3135943). I assume the NuGet package will be updated to be correct once MVC4 ships.

  • Leo Hernandez

    Thank you very much for posting this. With the latest changes in the RC, I wasn’t sure how to go about it.

  • Leo Hernandez

    Thank you very much for posting this. With the latest changes in the RC, I wasn’t sure how to go about it.