I am trying to delete a list that contains documents using the SharePoint 2010 CSOM and am using the following code:
//find the 'Project Documents' library and delete it var list = context.Web.Lists.GetByTitle("Project Documents"); list.DeleteObject(); context.ExecuteQuery();
But I always get the exception "This list cannot be deleted". The list is empty, but still I am not able to delete it. What am I doing wrong?