Pregunta

Tenemos 2 proyectos en Visual Studio.

El proyecto 1 tiene 2 características.

        Feature A is site scoped module 
        Feature B is web application scoped feature stapler. (empty element with FeatureSiteTemplateAssociation)

El Proyecto 2 tiene 1 característica (función x) que implementa la lista.

Quiero grapar la función X para contar con B. por lo que estoy colocando el ID de función de la función X en el elemento vacío (Función B) del Proyecto 1 AS: <FeatureSiteTemplateAssociation Id="IDofFeatureX" TemplateName="GLOBAL" />

es esta buena práctica?

¿Fue útil?

Solución

There is n o restriction as such that both the features should be in same project. It is always good practice to keep a separate project for site columns/content types/List & Libraries.Below are the points to be kept in mind while creating feature stapling:

  1. Staplee feature should be having higher scope than stapled feature. eg: if stapled feature is site collection or web scope , then staplee feature should be web app scoped.

  2. Since you are trying to activate the feature in every template ie TemplateName="GLOBAL" , it is helpful to understand about the AllowGlobalFeatureAssociations property of templates. If this property is set to FALSE, global association features will not be activated.So for such templates you will have to explicitly add FeatureSiteTemplateAssociation .Shared Services Provider site template and the Blank Site site template use the AllowGlobalFeatureAssociations="FALSE" property. Read this blog for more info.

Licenciado bajo: CC-BY-SA con atribución
scroll top