I have an ApiController in an Area of my MVC website, I'm injecting dependencies into it via Unity and my controllers extend the System.Web.Http.ApiController.
I'm using Unity from Microsoft.Practices.Unity.dll, v3.0.0.0.
I can route to the controller with the following in ApiAreaRegistration
context.MapRoute(
"Api_default",
"Api/users/{action}/{id}"
);
But I get the following error :
Type 'Project.Areas.Api.Controllers.UsersController' does not have a default constructor
However if I add a default constructor my dependencies don't get resolved.
I'm beginning to feel like I'm missing something structural?
MapRouteisn't related to your Unity problem. Is your controller extendingSystem.Web.Http.ApiController? Are you using theUnity.WebApipackage?