I try to run the following code:
using System.Web.Http;
using System.Web.Mvc;
using Conduit.Mam.ClientSerivces.Dal.Configuration;
using MamInfrastructure.Common.
In your Initialize
method replace:
GlobalConfiguration.Configuration.DependencyResolver = new UnityDependencyResolver(container);
with:
GlobalConfiguration.Configuration.DependencyResolver = new Unity.WebApi.UnityDependencyResolver(container);
Now you understand what the problem is:
System.Web.Http.Dependencies.IDependencyResolver (used by the Web API) and System.web.Mvc.IDependencyResolver (used by ASP.NET MVC) are two completely different types (even if they have the same name) and yet you attempt to assign both of them to the same type (UnityDependencyResolver
) which obviously cannot work.