clairernovotny / ninject

the ninja of .net dependency injectors
http://ninject.org/
Other
26 stars 5 forks source link

"An item with the same key has already been added" in ActivationCache #12

Open dj-technohead opened 6 years ago

dj-technohead commented 6 years ago

Running into this exception when trying to get something from the container. I've tried clearing the activation cache, but this doesn't seem to help. Also tried to get the source for the latest published nuget package (3.3.1) on github so that I can make the change to check for existence, but don't see a tagged 3.3.1. Last tagged is 3.2.3.

Non-fatal Exception: android.runtime.JavaProxyThrowable: System.ArgumentException: An item with the same key has already been added. Key: Ninject.Infrastructure.ReferenceEqualWeakReference at System.Collections.Generic.Dictionary2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x000c1] in <2c2663dbba3a4ea68e74453e2f54e4a4>:0 at System.Collections.Generic.Dictionary2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <2c2663dbba3a4ea68e74453e2f54e4a4>:0 at Ninject.Activation.Caching.ActivationCache.AddActivatedInstance (System.Object instance) [0x0001d] in <50364816da6e4b04a5a9b75a4002aaa2>:0 at Ninject.Activation.Strategies.ActivationCacheStrategy.Activate (Ninject.Activation.IContext context, Ninject.Activation.InstanceReference reference) [0x0000c] in <50364816da6e4b04a5a9b75a4002aaa2>:0 at Ninject.Activation.Pipeline+<>cDisplayClass2.b0 (Ninject.Activation.Strategies.IActivationStrategy s) [0x00000] in <50364816da6e4b04a5a9b75a4002aaa2>:0 at Ninject.Infrastructure.Language.ExtensionsForIEnumerableOfT.Map[T] (System.Collections.Generic.IEnumerable1[T] series, System.Action1[T] action) [0x00010] in <50364816da6e4b04a5a9b75a4002aaa2>:0 at Ninject.Activation.Pipeline.Activate (Ninject.Activation.IContext context, Ninject.Activation.InstanceReference reference) [0x00044] in <50364816da6e4b04a5a9b75a4002aaa2>:0 at Ninject.Activation.Context.ResolveInternal (System.Object scope) [0x000d9] in <50364816da6e4b04a5a9b75a4002aaa2>:0 at Ninject.Activation.Context.Resolve () [0x0004e] in <50364816da6e4b04a5a9b75a4002aaa2>:0 at Ninject.KernelBase.Resolve (Ninject.Activation.IRequest request, System.Boolean handleMissingBindings) [0x00160] in <50364816da6e4b04a5a9b75a4002aaa2>:0 at Ninject.KernelBase.Resolve (Ninject.Activation.IRequest request) [0x00000] in <50364816da6e4b04a5a9b75a4002aaa2>:0 at Ninject.ResolutionExtensions.GetResolutionIterator (Ninject.Syntax.IResolutionRoot root, System.Type service, System.Func2[T,TResult] constraint, System.Collections.Generic.IEnumerable1[T] parameters, System.Boolean isOptional, System.Boolean isUnique) [0x0002f] in <50364816da6e4b04a5a9b75a4002aaa2>:0 at Ninject.ResolutionExtensions.Get[T] (Ninject.Syntax.IResolutionRoot root, Ninject.Parameters.IParameter[] parameters) [0x00000] in <50364816da6e4b04a5a9b75a4002aaa2>:0