I have a WebAPI .Net application that used StructureMap as its DI. Recently I upgraded it to OWIN and Helios so getting rid of System.Web.dll
and so not having access to IHttpModule anymore. This project uses Entity Framework and it's important to manage DbContext life cycle correctly. Unfortunately that seems that StructureMap does not have proper life cycle for OWIN context. My StackOverflow question has been remained unanswered 6 days now. Also other people are trying to find a solution.
After all tries my team decided to replace StructureMap with a DI framework that has better integration with OWIN. There are many comparisons out there like this and this. But most of them are outdated and have nothing about OWIN. Whatever I learned from them is that Autofac is fast and easy while Ninject and Unity are slow. BTW I'm going to make a new comparison of popular DI frameworks Autofac, Ninject and Unity by myself. This comparison is done in Sep. 2015 and is based on their github and Nuget stats. All of them have support of OWIN.
|Number of questions in SO||1781||3032||2556|
|Latest Stable Version||3.5.2/August 12 2014||3.2.2/April 02 2014||3.5.1404/April 22 2014|
|NuGet Downloads (latest version)||306232||390602||630456|
All of them seems to be very simliar except that Unity has lower popularity in github that can be because of its shorter presense on Github. BTW this indicates that all these DIs are good enough and more investigations must be done by applying them in a real project.