title: Deletion of a directory with System.IO.Directory.Delete
body: <p>I have a c# application, in which i have to delete a directory:</p>
  
  <pre><code> if (buttonName == "Supprimer projet")
              {
                  if (url != null)
                  {
                      proj.DeleteDirectory(proj.GetProjectsId(url));
                      var path = Path.Combine(@"C:\Projets", url);
                      try
                      {
                          Directory.Delete(path);
                      }
                      catch { }
                      return RedirectToAction("Gestion", "Admin");
                  }
              }
  </code></pre>
  
  <p>but i have this exception <code>the directory is not empty \r\n</code> . </p>
  
  <p>What is the reason of this error? How can i fix it?</p>