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");
當我運行這段代碼,我得到異常:設有 ID「0af5989a-3aea-4519-8ab0-85d91abe39ff」未安裝在農場和 不能被添加到範圍。未能激活使用COM功能在SharePoint 2010
請指導有這個功能ID。
問候, 維克蘭特拉吉Behal