即使我检查地图是否已经包含了之前我添加它,我收到此错误的关键..C#具有相同键的项已被添加
if (ShortBuffer.ContainsKey(GetTuple(data))) return;
ShortBuffer.Add(GetTuple(data), <----- ERROR OCCURS HERE
new Tuple<Timer, int, bool, Data>(
new Timer(Convert.ToInt32(Ini.ReadValue("intervals", "clientbuffershort"))), 0, false, data));
的GetTuple方法:
private static Tuple<string, string, string> GetTuple(Data data)
{
return new Tuple<string, string, string>(data.AucxisErrorId, data.ClientId, data.Area);
}
有什么想法?谢谢!
是您的应用程序的多线程... – Eser
不,没有,这就是为什么我不明白这一点 –
然后,我们需要的代码重现问题是为了回答你的问题。 (简短但完整的代码示例) –