Index was outside the bounds of the array

Sep 18, 2009 at 7:27 PM

For some reason I seem to be getting the error:

Index was outside the bounds of the array.

at System.Collections.Generic.Stack`1.Pop()
   at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImports(ComposablePart part, Boolean shouldTrackImports)
   at System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImports(ComposablePart part)
   at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition)
   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue(ComposablePart part, ExportDefinition export, Boolean isSharedPart)
   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.CatalogExport.GetExportedValueCore()
   at System.ComponentModel.Composition.Primitives.Export.get_Value()
   at System.ComponentModel.Composition.ExportServices.GetExportedValueFromLazy[T](Export export)
   at System.ComponentModel.Composition.ExportServices.<>c__DisplayClassa`1.<CreateStronglyTypedExportOfT>b__7()
   at System.Lazy`1.get_Value()
   at IPoet.Silverlight.ServiceClient.ServiceLocator.GetObject[T]()
   at IPoet.Silverlight.ServiceClient.Collections.StaticListsBase.DownloadList[T](EntityQuery`1 query, Action callback)
   at IPoet.Silverlight.ServiceClient.Collections.StaticListsBase.DownloadQueue`1.DownloadUpdate(StaticListsBase lists)
   at IPoet.Silverlight.ServiceClient.Collections.StaticListsBase.BackgroundThread_DoWork(Object sender, DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.OnRun(Object argument)

Most of the time the call works fine, but sometimes I get this error. Could it be a threading issue since the code is running based on a timer?

Thanks!

Sep 18, 2009 at 7:43 PM

Yes, this looks like a threading issue.

You probably need to update to Preview 7, and pass 'true' to the container's constructor to enable thread safety.

Nick