I want to checkin and publish all the files inside a folder and its sub-folders
Below is my code
private void checkinFile(ClientContext ctx, string foldername) {
ctx.Load(ctx.Web, a => a.Lists);
ctx.ExecuteQuery();
List list = ctx.Web.Lists.GetByTitle(foldername);
var files = list.GetItems(
new CamlQuery()
{
ViewXml = @"<View Scope='RecursiveAll'><Query>
<Where><IsNotNull><FieldRef Name='CheckoutUser' /></IsNotNull></Where>
</Query></View>"
});
ctx.Load(files);
ctx.ExecuteQuery();
foreach (var file in files)
{
file.File.CheckIn("Add", CheckinType.MajorCheckIn);
Console.WriteLine("-----------------------");
Console.WriteLine("");
}
}
Usage
package.checkinFile(ctx, "Style Library");
This is not publishing/check-in the files the style library sub folders