System.IO.Directory.Delete Throws "the directory is not empty"

  • Thread starter Thread starter codeboy
  • Start date Start date
C

codeboy

I am using VS2008 to create a website. When I try to programmatically delete
a directory that is located within my website I will get an error. I am
trying to delete the directory using "System.IO.Directory.Delete(strDirPath,
true)". This is the message the error gives "the directory is not empty". I
found another entry titled "Directory.Delete of a non empty dir fails in
ASP.NET application". In that posting Walter Wang says: "the folder is
locked by Visual Studio 2005 IDE if the folder is already shown in project
explorer". Now that I am using VS2008 has this been changed? How can I test
my code? Please help me get past this problem.

Thanks
 
Please do not post the same question with two different subjects.
Doing this doesn't help you and is confusing.

Thank you for your cooperation.

I already gave you an answer as a reply to your first post.



Juan T. Llibre, asp.net MVP
¿ Estas probando VS 2010 y ASP.NET 4.0 ?
Regístrate (gratis) en los Foros de VS 2010 y ASP.NET 4.0, en español
http://asp.net.do/foros/forums/
=====================================================
 
Back
Top