Skip to content

VContainerSettings.Instance.RootLifetimeScope.Container is null #815

@lancelodliu

Description

@lancelodliu

Description:
Created a custom AppContext (inherits LifetimeScope) and assigned it as Root in a VContainerSettings asset. In a regular MonoBehaviour OnClick event I check:
VContainerSettings.Instance.RootLifetimeScope.Container == null
It is always true. I expected the root container to be built by then.
This only happens in 1.17.0 version but not in 1.13.2.

Environment:

Unity: 6000.0.28f1c1
VContainer: 1.17.0
Platform: Windows Editor Mode
Scripting Backend: Mono

Image

Steps To Reproduce:

Create AppContext: LifetimeScope, place it in the scene (enabled).
Create a VContainerSettings asset, assign the AppContext as Root.
Add a MonoBehaviour (TestBehaviour) to another GameObject.
Enter Play Mode.
Observe console logs: container remains null in when I click the GameObject.

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