B
Bob
Hi,
I am getting an error "The process cannot access the file because it
is being used by another process" when I debug a program more than
once. The file is being opened for append access with a FileStream.
I have implemented IDisposable with the following code, am I doing
something wrong or is there a problem with pressing the "stop
debugging" button to end a program in a situation like this?
public void Dispose()
{
file1.Close();
file2.Close();
file1 = null;
file2 = null;
GC.Collect();
}
Thanks,
Bob
I am getting an error "The process cannot access the file because it
is being used by another process" when I debug a program more than
once. The file is being opened for append access with a FileStream.
I have implemented IDisposable with the following code, am I doing
something wrong or is there a problem with pressing the "stop
debugging" button to end a program in a situation like this?
public void Dispose()
{
file1.Close();
file2.Close();
file1 = null;
file2 = null;
GC.Collect();
}
Thanks,
Bob