Skip to content
This repository was archived by the owner on Mar 2, 2023. It is now read-only.
This repository was archived by the owner on Mar 2, 2023. It is now read-only.

Web API Dependency Injection with Unity error - No public constructor is available for type System.Web.Http.Dispatcher.IHttpControllerActivator #17

Description

@nadeem1990

I am trying to implement the dependency injection in ASP.Net web API with unity container and have implemented the exactly with below 2 articles:

  1. https://stackoverflow.com/a/38770689/3698716
  2. https://docs.microsoft.com/en-us/aspnet/web-api/overview/advanced/dependency-injection

Both are related to each other with some minor change but implementation for both are the same.

After implementing I am getting an error in the method GetService in UnityResolver.cs class:

"Resolution failed with error: No public constructor is available for type System.Web.Http.Dispatcher.IHttpControllerActivator."

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions