In .Net 3.5, I have the following code.
If File.Exists(sFilePath & IndexFileName & ".NX") Then
Kill(sFilePath & IndexFileName & ".NX")
End If
At runtime on the same client computer, I get the following exception, over and over again when this code executes
Source: Microsoft.VisualBasic
TargetSite: Microsoft.VisualBasic.FileSystem.Kill
Message: No files found matching 'I:\RPG\HGIAPVXD.NX'.
StackTrace:
at Microsoft.VisualBasic.FileSystem.Kill(String PathName)
(More trace that identifies the exact line of code.)
There are two people on different computers working with this code, but only one of them gets an exception. An exception does not occur every time, but it happens regularly. (Several times per hour.) The code is not in a loop and does not run continuously, more than just every few minutes or so.
At first glance, this looks like a race condition, but given how rarely this code runs and how often an error occurs, I think there should be something else.
, , . , , .