-
Notifications
You must be signed in to change notification settings - Fork 152
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
Allow performing verification upon first resolve #555
Comments
I'm tempted to react with thumbs up because verification is something which separates Simple Injector from the rest and is also some kind of ultra climax of all design principles. However. I think the impact of the breaking change is huge and maybe too huge! Maybe there is an elegant solution which could be used in two ways. What do you think of including a .ps script in the NuGet package which generates some commented code? This could be both container.Verify(); and container.Options.EnableAutoVerification = true; of course shipped as a more or less complete bootstrapper.cs/bootstrapper.vb |
@TheBigRic nuget references can't use install.ps1 anymore. So this only works for the legacy references. |
@Tornhoof At this time it is probably more interesting to decide which path to take with this, to auto verify or not to auto verify, that's the question :-) |
feature-555 branch created. |
@davidroth I was trying to find out what the counter arguments would be for implementing this feature, as I now started working on implementing it. I suspect you downvoted because this feature was initially described as a breaking change (which it still is, but the breaking part is moved to #747). The issue has been updated several times, so it's very well possible that it was confusing to begin with. |
…toVerification will be set to true by default. #555
…toVerification will be set to true by default. #555
Many inexperienced users forget to call
Verify()
after configuring the container. To make it easier to do the right thing, we should consider automatically callingVerify()
when the first service is resolved, in case the user didn't call it.Since verification can cause performance problems for big applications, auto-verification should be configurable, for instance:
Having the feature enabled by default, however, is a major breaking change, because in case the user upgrades to this new version, without setting
EnableAutoVerification
tofalse
, it will cause the container to be verified, even though the user might explicitly prevented this in his production environment:In v4 the feature can be added, as long as it is off by default.
The text was updated successfully, but these errors were encountered: