VContainer
VContainer copied to clipboard
BugFix: Was able to create a component with `new` keyword
When working with source generators, if you try to do something like this on a class that inherits from Component, you will receive a NotSupportedException when trying to inject it.
builder.Register<SomeMonoBehaviour>(Lifetime.Singleton);
When working with reflection injection, the creation of a component that way is allowed.
This PR aims to align the implementations and to prevent a reflection created instances of Components.
⚠️ This might be a "breaking change" for some who used this approach in their project intentionally or not (in our case it was unintentional and it was causing havoc).
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| vcontainer | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 4, 2025 6:30am |