The problem is that if I put something in the background thread, then in the test run mode, the main thread does not know about it, and it just goes to the next code fragment for exectue and checks the result, but the point value is not updated to this in the background thread. So it gives an incorrect statement. The way to deal with this problem is to make the main thread wait / sleep until the background work is completed. Example:
Dim caller As AsyncMethodHandler Dim result As IAsyncResult caller = New AsyncMethodHandler(AddressOf lcl_service.CreateSession) result = caller.BeginInvoke(parameter, Nothing, AddressOf AsyncCallback, Nothing) While Not result.IsCompleted Thread.Sleep(1) End While
arun2808
source share