Hi!
I wrote a windows service, this service read a txt file and make some
task... the service works at 00:00, 00:30, 01:00, 01:30 etc... (every
half hour)
The problem is the txt, there is a dataloger that writes on it every 10
minutes, the dataloger and the service dont run at the same time, i.e:
Service: 00:00, 00:30, 01:00, 01:30 etc...
Dataloger: 00:05, 00:15, 00:25, 00:35 etc...
This works fine 3 or 4 times and then the dataloger crash with an I/O
error, can't write the txt file because the service had it blocked...
and i dont know what the hell is blocked the txt, i close the reader,
set it to nothing, call .finalize and
Try
srLector = New StreamReader(_File)
Catch ex As System.IO.IOException
EventLog1.WriteEntry("Error: " & ex.ToString)
End Try
..
..
srLector.DiscardBufferedData()
srLector.BaseStream.Close()
srLector.Close()
srLector = Nothing
..
..
Me.Finalize() ' when all the work is done...
I even try to copy the file and work with the copy but it crashes the
same way...
I know the problem is with the service, because it happens even when
the dataloger is not running, so PLEASE! if anyone knows what happend
write me a letter
Thanks in advance...
Jes