-
Notifications
You must be signed in to change notification settings - Fork 5
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
Any ideas how to avoid container.Verify(); problems? #13
Comments
Don't do anything with SimpleInjector. So sry no idea. But if you know a fix for this problem. I'd happily take PR's. |
I've come up with a bit of a solution that provides some value with
Some notes, @dotnetjunkie would possibly be able to provide some guidance in places:
|
This problem is not limited to Simple Injector. Other DI Containers do up-front verification (although most do not include diagnostics OOTB). One of those DI Containers that might cause you to run into problems is Microsoft.Extensions.DependencyInjection v3.0. It allows iterating all registrations and instantiating them all (using The issue raised here, unfortunately, lacks enough details for me to see what's going on, but it could be caused by the injection on some runtime data that might not be available during verification. If Akka injects runtime data objects into constructors of consumers, it means it applies the Closure Composition Model. That's not a bad thing per se, but does force require special care to allow object graphs to be verified. For instance, a practice you can apply when using Simple Injector is make the registration for the runtime data with a delegate that checks if the container is currently in verification (using |
Hi there.
Just wanted to ask if someone has a clue on how to avoid errors on
container.Verify()
.When you verify the container it tries to create all registrations. Which isn't really good for actor classes as one would know. Not that it actually is a problem, but it throws annoying error messages like "no active Context or ActorSystem or whatnot".
The text was updated successfully, but these errors were encountered: