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

Discussion in 'ASP .Net' started by codeboy, Jun 8, 2009.

  1. codeboy

    codeboy Guest

    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
    codeboy, Jun 8, 2009
    #1
    1. Advertising

  2. 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/
    =====================================================
    "codeboy" <> wrote in message
    news:...
    >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
    >
    Juan T. Llibre, Jun 8, 2009
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DotNetGruven
    Replies:
    3
    Views:
    1,028
    Steven Cheng[MSFT]
    Apr 27, 2004
  2. Chris Newby
    Replies:
    0
    Views:
    416
    Chris Newby
    May 16, 2005
  3. John Dalberg
    Replies:
    4
    Views:
    3,288
    Alexey Smirnov
    May 10, 2007
  4. Nathan Sokalski
    Replies:
    2
    Views:
    1,117
  5. codeboy
    Replies:
    3
    Views:
    707
    Juan T. Llibre
    Jun 8, 2009
Loading...

Share This Page