I keep getting the following error in my applictaion:
"Object synchronization method was called from an unsynchronized block of code."
Heres the part of code the error is occurring at:
Does anybody see the error of my ways?
"Object synchronization method was called from an unsynchronized block of code."
Heres the part of code the error is occurring at:
Code:
Public SuccessFax As New SuccessFaxCheck
If Monitor.TryEnter(SuccessFax, 1000) = True Then
If aServer.Equals(faxSvr1) Then '1.18
'check if there has been at least one successful fax sent
If SuccessFax.Svr1Success = True Then
If DateDiff(DateInterval.Minute, SuccessFax.sFax1, Now()) > basMod.IntervalBetweenSuccesses Then
basMod.SendAlertMail(6, aServer)
SuccessFax.Svr1SuccessReceived = False
WriteToXML(1, faxSvr1) 'set settings variable to false
success = False
Else
success = True
End If
Else
success = True
End If
ElseIf aServer.Equals(faxSvr2) Then '10.5
'check if there has been at least one successful fax sent
If SuccessFax.Svr2Success = True Then
If DateDiff(DateInterval.Minute, SuccessFax.sFax2, Now()) > basMod.IntervalBetweenSuccesses Then
basMod.SendAlertMail(6, aServer)
SuccessFax.Svr2SuccessReceived = False
WriteToXML(1, faxSvr2) 'set settings variable to false
success = False
Else '<--ERROR OCCURS HERE
success = True
End If
Else
success = True
End If
End If
Monitor.Exit(SuccessFax)
End If
Does anybody see the error of my ways?