Index was outside the bounds of the array错误,如何解决?

[已解决] Index was outside the bounds of the array错误,如何解决?

20
[软件及编程 > C#]
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Collections.Generic.Dictionary`2.Resize()
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)

这是什么问题?我使用Add方法添加,Key也没有重复,怎么会出错的呢?
提问时间:2010/7/20 11:36:45 | 提问者:GaLiJiKuai | 悬赏:20 | 浏览:9292
最佳答案
你是不是用了多线程访问这个Dictionary的?如果是的话,可以使用lock锁,并且可以试试看dic[xx] = xx的方式赋值。
回答时间:2010/7/20 12:35:19 | 回答者:Souidea
其他参考答案(0)
提交失败!请检查错误!错误信息:

注:以上所有信息由网友提供,仅供交流、参考,均不代表盛派网络言论,如果有任何问题或不妥,请立即联系我们

以下信息或许对您有用: