|
-
September 15th, 2009, 12:12 PM
#1
File.Delete File.Move Only Works in Debug
This is an odd one.
With all the guts out I have this:
TextReader tr = new StreamReader("List.txt");
TextWriter tw = new StreamWriter("List2.txt");
//Guts
tw.Close();
tr.Close();
File.Delete("List.txt");
File.Move("List2.txt", "List.txt");
When I run this I get an error of:
An unhandled exception of type 'System.IO.IOException' occurred in mscorlib.dll
Additional information: The process cannot access the file 'List.txt' because it is being used by another process.
Yet.. When I debug and go through it step by step, it works perfectly.. Odd.. any clues?
Cheers.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|