Closed michael-dots closed 4 years ago
Duplicate unitycontainer/unity#314
This behavior is mandated by Microsoft Dependency Injection specification. It would not pass compatibility tests without it.
You could stop this behavior by registering List<>
with constructor of your choice specified by InjectionConstructor
container.RegisterType(typeof(List<>), new InjectionConstructor())
container.RegisterType(typeof(IList<>), typeof(List<>), new InjectionConstructor())
Hi,
I'm having trouble with resolving IEnumerable strings if a string is also registered, this must surely be a bug?
I discovered the problem when updating from an old version to the newest, and narrowed it down to between Unity.Container 5.8.13 and 5.9.0.
Reproduction code, .net core console:
After 5.9.0: Before = 0, After = 1 / Why
Before 5.9.0: Before = 0, After = 0 /
Sorry if this is the wrong issue tracker, I found some similar closed cases here so assume it's the right place.