locked
ASP.NET WebApi wih Unity Container dependency injection RRS feed

  • Question

  • User643870454 posted

    Hi,

    We are using Unity container has dependency injection in our code. We have followed below link

    http://www.asp.net/web-api/overview/advanced/dependency-injection

    But when GetService(Type serviceType ) is called, some of the type doesn't loads and throws exception like"

    Resolution of the dependency failed, type = "System.Net.Http.Formatting.IContentNegotiator", name = "(none)".
    Exception occurred while: while resolving.
    Exception is: InvalidOperationException - The current type, System.Net.Http.Formatting.IContentNegotiator, is an interface and cannot be constructed. Are you missing a type mapping?


     Has any one faced same issue with WEB API and unity container dependency resolver?

    Wednesday, June 17, 2015 4:05 PM

Answers