I have been trying to enable new list experience on a document library programmatically using CSOM C# in my app.
First I checked the settings in the SharePoint admin center where SharePoint Lists and Libraries experience is set to "New experience (auto detect). "
Then I checked the default document library under advanced settings where the List experience is set to "Default experience set by my administrator. " Please note that this is the default setting - if I change this manually to "new experience" it works, however I want to enable this programmatically!
I then tried to google the issue and found this guide to switch the default for document libraries from new or classic here: https://support.office.com/en-us/article/Switch-the-default-for-document-libraries-from-new-or-classic-66dac24b-4177-4775-bf50-3d267318caa9
This pretty much explained what I already knew, but it also explained a way of enabling the new experience by removing a feature on the Site Collection scope or web scope.
Site collection example:
Guid featureguidSite = new Guid("E3540C7D-6BEA-403C-A224-1A12EAFEE4C4");
context.Site.Features.Remove(featureguidSite, true);
context.ExecuteQuery();
Website example:
Guid featureguidWeb = new Guid("52E14B6F-B1BB-4969-B89B-C4FAA56745EF");
context.Web.Features.Remove(featureguidWeb, true);
context.ExecuteQuery();
I have tried the above mentioned code and found that neither feature was enabled.
I have also looked at the SharePoint client site list members here without luck.
So does anyone know of a way to enable the new list experience on document libraries by code? Preferably in CSOM C#.
From what I can read out of the description in SharePoint admin center settings it should work as long as there is no customization enabled on the list - and as it is a default list on the website there should not be any customization? Or am I wrong?
The new experience gives people improved performance, additional phone and tablet features, and a simplified UI. Select the new experience (auto detect) option when you want to use the classic experience for libraries that have features or customizations enabled that only work in the classic experience, and use the new experience for libraries that don't have these features or customizations enabled. If you select the new experience, users can still switch to the classic experience if they want. Select the classic experience if you're not ready for your users to switch to the new experience. Note that eventually, the classic experience will no longer be available.