Hmmm... I just double checked the code and this should have been addressed quite a while ago. But now that I'm checking I'm seeing that the initialization code actually isn't properly blocked into a lock() section (it was commented out). I've just added it back in.
Hi Jackie,
Did you ever find out what was the cause of this issue? We have started to see the same issue intermittently.
Thanks
Stephen
Hi Rick,
When we using the WestWind Web Toolkit in our web site for localization, we get the below exception intermittently:
String Message = "An error ocurred whilst trying to load your content, Index was outside the bounds of the array.
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Collections.Generic.List`1.Add(T item)
at Westwind.Globalization.DbSimpleResourceProvider..ctor(String virtualPath, String className)
at Westwind.Globalization.DbSimpleResourceProviderFactory.CreateLocalResourceProvider(String virtualPath)
at System.Web.Compilation.ResourceExpressionBuilder.GetLocalResourceProvider(VirtualPath virtualPath)
at System.Web.UI.TemplateControl.GetLocalResourceObject(String resourceKey)
..................................................................................
The exception is from below code:
public DbSimpleResourceProvider(string virtualPath, string className)
{
if (!ProviderLoaded)
ProviderLoaded = true;
_ResourceSetName = className;
DbResourceConfiguration.LoadedProviders.Add(this);
}
I think it may be a concurrency issue, do you think the LoadedProviders list should be locked when adding new providers to it?
Thanks,
Jackie