Guid featureId = new Guid("0af5989a-3aea-4519-8ab0-85d91abe39ff");
ClientContext clientContext = new ClientContext("http://mysite:786/");
Site clientSite = clientContext.Site;
clientContext.Load(clientSite);
FeatureCollection clientSiteFeatures = clientSite.Features;
clientContext.Load(clientSiteFeatures);
clientContext.ExecuteQuery();
// Activate the feature
clientSite.Features.Add(featureId, true, FeatureDefinitionScope.Site);
//clientSiteFeatures.Remove(featureId, false);
clientContext.ExecuteQuery();
MessageBox.Show("Success");
When I am running this code, I am getting the exception: Feature with id "0af5989a-3aea-4519-8ab0-85d91abe39ff" isn't installed in farm and can't be added to scope.
I got this feature id from the link http://social.technet.microsoft.com/wiki/contents/articles/7695.list-of-sharepoint-2010-features-id-displayname-and-scopes.aspx
Please guide.
Regards, Vikrant Raj Behal