It's hard to debug this error, my program is something like the following:
```
// try to schedule a one gmail checking
while(true)
{
-open connection
-login
foreach(var mes in Messages)
{
if(mess.Process()) => go into infinite loop after about 1.5 day ~ 400th loops, hard to debug.
{
// do something
}
}
- logout and close connection
- wait 5 minutes
}
```
Comments: ** Comment from web user: conquerorvn **
Hi,
I've found an scenario which cause nonstop process, my code as below
if (imapClient.Connection())
{
bool isLogged = imapClient.LogIn(emailGetInfo.Email, emailGetInfo.Password);
if(isLogged)
{
Folder folder = imapClient.Folders["INBOX"]; // the suspicious line: cant stop when I quick watch imapClient before run into.
// do something.
}
}
The scenario is:
- Test Unit the function check which has the codes, and I set a breakpoint at the suspicious line .
- Case 1:
. Run step out the line without on-the-fly watch (watch the variable value by click mouse on the variable) the 'imapClient' variable => it worked.
- Case 2:
. Before run step out the line, I did on-the-fly watch the 'imapClient' variable, then run step out => it cant stop. This case I tried to debug step into, then I found that It stop at line 380 in ImapBase.cs as following:
string text2 = UseSSL ? ImapSslStreamReader.ReadLine() : ImapStreamReader.ReadLine();
I hope It clearer for you,
TuanNM