I am trying to get .doc file names from SharePoint and then get the file by the name.
But I have a problem to using GetList() from this link.
So far I have a code:
string url = "https://mysharepoint.com/Things";
var ctx = new ClientContext(url);
Web web = ctx.Web;
var list = web.GetList("/Shared%20Documents/Test");
var listItems = list.GetItems(new CamlQuery());
ctx.Load(listItems,
items => items.Include(
item => item["Created"],
item => item.File));
ctx.ExecuteQuery();
foreach(var item in listItems) {
Console.WriteLine("{0} - {1}",
item["Created"],
item.File.ServerRelativeUrl);
}
But I can't understand why I have that Error:
Severity Code Description Project File Line Suppression State
Error CS1061 'Web' does not contain a definition for 'GetList' and no accessible extension method 'GetList' accepting a first argument of type 'Web' could be found (are you missing a using directive or an assembly reference?) MestoDljaProb C:\Ribbon1.cs 111 Active