Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Ninject for .NET Standard to not fall over in the constructor strategy when doing default bindings #801

Closed
einari opened this issue Apr 12, 2017 · 2 comments
Milestone

Comments

@einari
Copy link
Contributor

einari commented Apr 12, 2017

No description provided.

@einari einari added this to the 1.2.0 milestone Apr 12, 2017
@einari
Copy link
Contributor Author

einari commented Apr 12, 2017

Turns out that this is a bug in Ninject - see here

@einari
Copy link
Contributor Author

einari commented Apr 12, 2017

Adding a workaround for it by replacing the ConstructorReflectionStrategy through the Components registrations in Ninject by a custom one that leads to a custom ConstructorInjectionDirective that ultimately leads to a custom ParameterTarget which deals with the bug. This way we get to move forward and can rely on the default package out there for version 4 of Ninject.

Considering a pull request back to Ninject.

In Container.cs this will ultimately be:

kernel.Components.Remove<global::Ninject.Planning.Strategies.IPlanningStrategy, global::Ninject.Planning.Strategies.ConstructorReflectionStrategy>();
kernel.Components.Add<global::Ninject.Planning.Strategies.IPlanningStrategy, ConstructorReflectionStrategy>();

@einari einari closed this as completed in 324ee57 Apr 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant