For now, I have enhanced the method like this:
Public Function FileToStr(ByVal tcFileName As String) As String
Dim lcString As String = ""
Dim lnCounter As Integer = 0
Dim lnDelay As Integer = 250
Dim lnRetry As Integer = 8
Dim loFile As IO.StreamReader
For lnCounter = 1 To lnRetry
Try
loFile = New IO.StreamReader(tcFileName, True)
lcString = loFile.ReadToEnd()
loFile.Close()
Catch loError As Exception
If lnCounter < 8 Then
System.Threading.Thread.Sleep(lnDelay)
Continue For
End If
If oProcess Is Nothing Then
oApp.ErrorSetup(loError)
Else
oProcess.ErrorSetup(loError)
End If
End Try
Next
Return lcString
End Function
It has a maximum retries to 8 and an interval of .25 second.