Please look at my code below and let me know where I’m going wrong. This code is not working to reorder a list’s content type order using CSOM.
List aeList = context.Web.Lists.GetByTitle(“Events and Announcements Demo1”); ContentTypeCollection oContentTypes = aeList.ContentTypes;
Folder rootFolder = aeList.RootFolder; ContentType[] orderedContentTypes = new ContentType[1];
foreach (ContentType oContentType in oContentTypes) { if (oContentType.Name == "Events and Announcements") { orderedContentTypes[0] = oContentType.Id; rootFolder.UniqueContentTypeOrder = orderedContentTypes[0]; /*I'm receiving Cannot implicitly convert type 'Microsoft.SharePoint.Client.ContentType' to 'System.Collections.Generic.IList<Microsoft.SharePoint.Client.ContentTypeId>' error here*/ rootFolder.Update(); context.ExecuteQuery(); } } Console.WriteLine("Events and Announcements content type is set to default");