Call stack points at call to "SingleOrDefault" in the method "GetUserFromNickName(string nickName, bool isOnline, out bool creatdNew)"
specific line is as follows:
var user = this.users.SingleOrDefault(u => u.NickName == nickname);
Perhaps the call to "lock (((ICollection)this.userReadonly).SyncRoot)" should be called before the above line instead of after as the above linq does an enumeration.
Error Message:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at System.Collections.Generic.List`1.Enumerator.MoveNext()
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at IrcDotNet.IrcClient.GetUserFromNickName(String nickName, Boolean isOnline, Boolean& createdNew)
at IrcDotNet.IrcClient.GetMessageTarget(String targetName)
at IrcDotNet.IrcClient.ProcessMessageNoticeb__d(String n)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at IrcDotNet.IrcClient.ProcessMessageNotice(IrcMessage message)
at IrcDotNet.IrcClient.ReadMessage(IrcMessage message, String line)
Fixed on GitHub by <https:/ /github. com/alexreg/ ircdotnet/ pull/2>.