IndexOutOfRangeException After ApplicationPool Recycle
description
<p>It looks like the List within DependencyResolverTracker.AddResolverKey is used in a way which is possibly not be thread-safe.</p>
<p> </p>
<p>This caused us many IndexOutOfRangeExceptions randomly after an application pool recycle. Simply recycling the application pool again resolved the issue.</p>
<p> </p>
<p>Details of the stack are</p>
<p> </p>
<p>Exception is: IndexOutOfRangeException - Index was outside the bounds of the array. &#xD;&#xA;-----------------------------------------------&#xD;&#xA; At the time of the exception, the container was:&#xD;&#xA;&#xD;&#xA; Resolving Fred.Services.Person.ViewListing,ServiceHost (mapped from Fred.Services.Person.IViewListing, ServiceHost)&#xD;&#xA; ----&gt; System.IndexOutOfRangeException: Index was outside the bounds of the array.&#xA; at System.Collections.Generic.List`1.Add(T item)&#xD;&#xA; at Microsoft.Practices.ObjectBuilder2.ConstructorSelectorPolicyBase`1.CreateSelectedConstructor(IBuilderContext context, IPolicyList resolverPolicyDestination, ConstructorInfo ctor) in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\ObjectBuilder\Strategies\BuildPl...)." time="2012-02-16T21:14:59.0249474Z"></p>
<p> </p>
<p> </p>
<p>See this discussion for further info on it.</p>
<p>http://unity.codeplex.com/discussions/328841</p>
<p> </p>
<p>Thanks</p>
<p>Rick</p>