hadashiA / VContainer

The extra fast, minimum code size, GC-free DI (Dependency Injection) library running on Unity Game Engine.
https://vcontainer.hadashikick.jp
MIT License
1.88k stars 163 forks source link

Injecting from child into parent #613

Open DanielDPielok opened 7 months ago

DanielDPielok commented 7 months ago

Hi,

First I have to thank you for providing such an awesome framework for free. We really enjoy working with it in several projects now. But we have one issue which we are not able to solve yet: I am trying to inject an instance from a child LifetimeScope into a registered class in it's parent LifetimeScope. The other way around works perfectly fine, I can register an instance in the parent and all injects of that instance in all classes of the child scope can be resolved. Can you give me a hint?

Thanks in advance.
Daniel

hadashiA commented 7 months ago

Interesting report.. Thanks for looking into it.

For example a base class, that is located in another csproj)

I see. Perhaps it's because I'm checking the [Inject] method and ctor back to the base class.

I will try to address this. Thanks.