【发布时间】:2016-03-12 17:10:54
【问题描述】:
我正在尝试使用 CSOM 在我们的本地环境中以编程方式打开网站集功能。
我不断收到错误:
Feature with Id '7201d6a4-a5d3-49a1-8c19-19c4bac6e668' is not installed in this farm, and cannot be added to this scope.
我通过 GUI 检查网站集功能,它在那里,所以我认为它已打开(并且它是 OOTB)。
为什么会这样?
代码:
try
{
if (featureNode.Attributes != null)
{
string guid = featureNode.Attributes["ID"].Value;
string featureName = featureNode.Attributes["FeatureName"].Value;
Guid featureGUID = new Guid(guid);
if (isSiteColl)
{
currentFeatures.Add(featureGUID, false, FeatureDefinitionScope.Site);
currentContext.ExecuteQuery();
}
else
{
currentFeatures.Add(featureGUID, false, FeatureDefinitionScope.None);
currentContext.ExecuteQuery();
}
}
}
【问题讨论】:
标签: .net sharepoint csom