0

I'm facing a problem and can't work it arround.

Iterating through the messages queue , I wanna resend or delete some of them, but as soon as I try to remove the current message, it removes the message but my iteration exits and the program continues.

MessageEnumerator enumerator = queue.GetMessageEnumerator2();

while (enumerator.MoveNext())
{
    //Check some stuff to resend or remove              

    enumerator.RemoveCurrent();         
}

Why it does not keep on iterating through the rest of messages availables in the queue?

Thanks.

fgc
  • 79
  • 1
  • 1
  • 13
  • Ok, finally I got it, it was already answered [here](https://stackoverflow.com/questions/21864043/with-messageenumerator-removecurrent-how-do-i-know-if-i-am-at-end-of-queue) – fgc Feb 14 '19 at 12:49
  • Possible duplicate of [with MessageEnumerator RemoveCurrent how do I know if I am at end of queue?](https://stackoverflow.com/questions/21864043/with-messageenumerator-removecurrent-how-do-i-know-if-i-am-at-end-of-queue) – tom redfern Feb 14 '19 at 13:31

0 Answers0