2

I am trying to get the names of all the features available at site collection using CSOM. Below code works fine to get list of all the Features but i am unable to get the DisplayName property.

            ClientContext clientContext = new ClientContext(URL);
            Web oWebsite = clientContext.Web;
            clientContext.Load(oWebsite, website => website.MasterUrl, website => website.CustomMasterUrl, website => website.Features);
            clientContext.ExecuteQuery();
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Authenticated!");
            Console.ForegroundColor = defaultForeground;

            var webFeatures = clientContext.Web.Features;
            clientContext.Load(webFeatures, fcol => fcol.Include( f => f.DefinitionId));
            clientContext.ExecuteQuery();
            foreach (var f in webFeatures)
            {
                Console.WriteLine(f.DefinitionId);
            }

Here is a post that explains how to get the DisplayName but its not working for me.

I have upgraded the SDK for SP2013 but still i am unable to find this property. Can you please let me know if this is at all possible?

1

Include the DisplayName in your .Include:

clientContext.Load(webFeatures, fcol => fcol.Include( f => f.DefinitionId, f=> f.DisplayName));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.