-
Notifications
You must be signed in to change notification settings - Fork 529
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
Call kernel.Get<T> two times do not give the same result #262
Comments
Could you provide the code for "copy & paste" so we can easily reproduce the issue? |
To summarize the issue: When a Type ( The expected outcome would be to throw the same |
You perfectly summarized the topic and the expected outcome. Here is sample code :
|
Hi BrunoJuchli and scott-xu, |
Ninject Version : Current Release (Version 3.2)
In sample application below, we want to verify that multiple call to Get give the same result : throw Activation Exception - because we did not bind any IWeapon object - .
The first call is OK, exception is raised (visualized in Text Visualizer) :
Unfortunnately, the second call does not throw exception and return an instance of Samurai.
This is not what we expect.
We check that Context class uses Cache for Resolution :
(Cache is not cleared, even if ActivationException occurs after)
This behavior is strange (same method Get called twice gives different result), but maybe we are wrong in our expected result ? Or Maybe we have to modify Ninject Setting ? (We turned ActivationCacheDisabled to True, but no impact)
Note : same behavior in pending V4 version.
Someone could help ?
Thanks.
The text was updated successfully, but these errors were encountered: