The StructureMap.WebApi2 package has a dependency to StructureMap.MVC5 which in return has a dependency to System.Web.Mvc.
As we are building a Web API-only project we don't want to include the System.Web.Mvc assembly.
Is it possible to use StructureMap in Web API 2 without this dependency?
Sadly no.
StructureMap
is made forMVC
so it obviously depends on it.Why do you insist on using
StructureMap
though? All it does isDI
and there are many other options to doDI
inWeb API
, likeNinject
andUnity
.