StructureMap dependency resolver for Web API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This gives you all the pieces you need to hook up StructureMap as your Inversion of Control container for ASP.NET Web API.


The best way to get your hands on WebApiContrib.IoC.StructureMap is to grab the package from NuGet:

Install-Package WebApiContrib.IoC.StructureMap

How to Use

Using the WebApiContrib StructureMap container is easy.

var config = GlobalConfiguration.Configuration;
var container = GetYourOwnBuiltContainer(); // You build this up yourself.
config.DependencyResolver = new StructureMapResolver(container);

One thing that is unique about this resolver is that it is also an instance of IHttpControllerActivator. Upon creation of the StructureMapResolver, it injects itself as the object to be returned when IHttpControllerActivator is requested.

Help! - Issues, Questions, and Anything Else

If you're in need of any assistance, your fastest method to get in touch with somebody that might be able to help is through the WebApiContrib mailing list:

Another great way is to leave an issue on the GitHub repository.

For StructureMap specific questions, please see the StructureMap documentation.