Collection was modified; enumeration operation may not execute. Lock is being used everywhere how possible?
问题 This is a small program that only i am writing and using. Now i am going to write code of all areas where i use the hashset that caused this problem I don't understand how this is possible. This item is being used only at MainWindow hsProxyList is a hashset HashSet<string> hsProxyList = new HashSet<string>(); the error happened at below iteration lock (hsProxyList) { int irRandomProxyNumber = GenerateRandomValue.GenerateRandomValueMin(hsProxyList.Count, 0); int irLocalCounter = 0; foreach