Why "delete" file hang?

G

Guest

The code below hung during execution at "File.Delete(testFile)"...

if (File.Exists(testFile))
{
Console.WriteLine("Before jumping off the cliff...");
File.Delete(testFile);
}

Console.WriteLine("Arrived here...");

Though "Before jumping off the cliff..." was printed out, "Arrived here..."
was never printed out.

In addition, I checked the directory and confirmed that the file "TestFile"
was gone. Not sure if it was deleted by this File.Delete or some other code.

Does anyone know of the issue?

Thanks!
 
P

Peter Duniho

[...]
Though "Before jumping off the cliff..." was printed out, "Arrived
here..."
was never printed out.

What does the debugger show you when you step through the code?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top