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.

If you liked this post, consider subscribing to email updates about my new posts, or sharing it on Hacker News.

Keyboard shortcuts

?
Show this help
Esc
Close this help or an open menu
n
Next (newer) post: aspConf 2012 Sessions
p
Previous (older) post: Gas Pump UI Failure
Tab
Move between links and buttons (Shift+Tab to go back)