C
C#2y ago
koopa

Collection was modified enumeration operation may not execute

Hi - I am working on a client - server chat application for my school project. The server app has a list called "messageRecievedList" which received messages are appended to. Whenever this list is appended, the function UpdateMessageModification() is called to re print all the messages. However, it causes this problem at completely RANDOM times (I.e. I can send 40 messages from a client fine or sometimes it will only be 26 or something)
3 Replies
koopa
koopa2y ago
The "msglist" does not get modified during the for loop at all
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
koopa
koopa2y ago
Yeah you're right it fixed when I set it to a copy, thank you Didn't really understand how references worked