部署步骤“激活功能”中发生错误:无法完成此操作
-
29-09-2020 - |
题
在我的SharePoint 2013解决方案(从Visual Studio创建)中,我创建了一个项目,其中包含我解决方案的所有伪像的项目:我放入了本项目自定义字段,自定义内容类型以及我的解决方案所需的自定义列表。< / p>
然后我在此项目中创建了3个功能:
一个网站范围的第一个功能包含我的解决方案的所有自定义内容类型和自定义字段,它的名称是 feature_contenttypes_fields 。
第二个功能是一个站点范围特征,并包含我的自定义列表 (其中我将“feature_contenttypes_fields”添加为功能激活依赖项) ,它的名称是 Feature_ListDefinitions 。
一个web范围的最后一个功能管理我的自定义列表所有列表实例的创建 (我添加了“feature_listdefinitions “作为特征激活依赖性) ,它的名称是 feature_listinstances 。
我可以成功构建解决方案,但它无法部署。
以下是在部署解决方案时的输出:
------部署已启动:项目:型号,配置:调试任何CPU ------活动部署配置:默认跳过部署步骤,因为未指定预部署命令。回收IIS. 应用程序池:回收IIS应用程序池的SharePoint - 1111'...缩回解决方案:取消激活功能 'model_feature_listdefinitions'...取消激活功能 'model_feature_contenttypes_fields'...撤回解决方案 'model.wsp'...删除解决方案'model.wsp'...添加解决方案:
添加解决方案'model.wsp'...部署解决方案'model.wsp'...
激活功能:激活功能'feature_contenttypes_fields' ...激活功能'feature_listdefinitions'...激活 功能'feature_listinstances'...部署步骤中发生错误 '激活功能':无法完成此操作。
在这里,您可以找到列表定义功能的清单:
<Feature xmlns="http://schemas.microsoft.com/sharepoint/" Title="Model ListDefinitions" Id="ab765f54-0a2b-4aa9-b87c-f5066849dc4a" Scope="Site"> <ActivationDependencies>
<ActivationDependency FeatureId="10412a7b-e033-43a0-a485-1c4f4c83ccca" FeatureTitle="Model ContentTypes_Fields" /> </ActivationDependencies> <ElementManifests>
<ElementFile Location="CVs\EditDlg.htm" />
<ElementManifest Location="CVs\Elements.xml" />
<ElementFile Location="CVs\FileDlg.htm" />
<ElementFile Location="CVs\Repair.aspx" />
<ElementFile Location="CVs\Schema.xml" />
<ElementFile Location="CVs\Upload.aspx" />
<ElementManifest Location="Notes\Elements.xml" />
<ElementFile Location="Notes\Schema.xml" />
<ElementManifest Location="Activites\Elements.xml" />
<ElementFile Location="Activites\Schema.xml" />
<ElementManifest Location="Demandes RDV\Elements.xml" />
<ElementFile Location="Demandes RDV\Schema.xml" />
<ElementManifest Location="Entretiens\Elements.xml" />
<ElementFile Location="Entretiens\Schema.xml" />
<ElementManifest Location="Formations\Elements.xml" />
<ElementFile Location="Formations\Schema.xml" />
<ElementManifest Location="Idees\Elements.xml" />
<ElementFile Location="Idees\Schema.xml" />
<ElementManifest Location="Mensualites\Elements.xml" />
<ElementFile Location="Mensualites\Schema.xml" /> </ElementManifests> </Feature>
和列表实例的清单功能:
<Feature xmlns="http://schemas.microsoft.com/sharepoint/" Title="Model ListInstances" Id="d61d526e-0e16-4bd4-87e1-1479d405e230" Scope="Web"> <ActivationDependencies>
<ActivationDependency FeatureId="ab765f54-0a2b-4aa9-b87c-f5066849dc4a" FeatureTitle="Model ListDefinitions" /> </ActivationDependencies> <ElementManifests>
<ElementManifest Location="FormationsInstance\Elements.xml" />
<ElementManifest Location="EntretiensInstance\Elements.xml" />
<ElementManifest Location="Demandes RDV Instance\Elements.xml" />
<ElementManifest Location="CVsInstance\Elements.xml" />
<ElementManifest Location="ActivitesInstance\Elements.xml" />
<ElementManifest Location="MensualitesInstance\Elements.xml" />
<ElementManifest Location="NotesInstance\Elements.xml" />
<ElementManifest Location="IdeesInstance\Elements.xml" /> </ElementManifests> </Feature>
有人可以帮我吗?
解决方案
列表实例必须具有maches您的ListDefinition的功能的FeatureDID属性。
默认情况下没有添加,所以这就是这样,这就是你得到的原因“无法完成这个动作”。
e.g。
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ListInstance Title="ListDef"
OnQuickLaunch="TRUE"
TemplateType="10000"
Url="Lists/ListDef"
Description="My List Instance" FeatureId="ab765f54-0a2b-4aa9-b87c-f5066849dc4a">
</ListInstance>
</Elements>
.