Skip to content

Mvc unable to resolve controllers not registered as services #27

Description

@TheJayMann

I am not sure if this is by design or not (the getting started and sample MVC application appear to suggest that it might not be), but when attempting to get one of my existing MVC projects ported over from a different dependency injection service to instead use this one, I was unable to get controllers to work with dependency injection unless I had added the controllers as services themselves. It appears this is due to the Mvc package having no path to ActivatorUtilities.CreateInstance (or, in this case, ActivatorUtilities.CreateFactory). It is only called by RequiredObjectFactoryFactory, which itself is only used when calling GetRequiredService, where Mvc only calls TryGetService.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions