No es capaz de implementar la plantilla web personalizada en el alcance de la granja
-
10-12-2019 - |
Pregunta
He desarrollado una plantilla web personalizada basada en "BDR # 0" en SP 2013. Funciona perfecto y puedo implementarlo con la función de alcance del sitio.La plantilla web se desarrolla agregando un módulo en VS 2012, que incluye elementos elementos.xml y onet.xml como se ve a continuación:
Quiero implementar la plantilla web en el alcance de la granja, pero cuando se implementé con la función de alcance de la granja, da un error siguiente:
El artículo del proyecto "DCWEBTEMPLA" no se puede implementar a través de una característica con el alcance de la granja. Qué ocurre ?
Solución
This happens because your DCWebTemplate is a module.
You can't use a module to deploy to farm. If you check your spi-file you can see the attribute SupportedDeploymentScopes is only web and site.
<ProjectItem Type="Microsoft.VisualStudio.SharePoint.Module" SupportedTrustLevels="All" SupportedDeploymentScopes="Web, Site" xmlns="http://schemas.microsoft.com/VisualStudio/2010/SharePointTools/SharePointProjectItemModel">
Instead you should use a Empty Element item. Below is the spi for that type.
<ProjectItem Type="Microsoft.VisualStudio.SharePoint.GenericElement" DefaultFile="Elements.xml" SupportedTrustLevels="All" SupportedDeploymentScopes="Web, Site, WebApplication, Farm, Package" xmlns="http://schemas.microsoft.com/VisualStudio/2010/SharePointTools/SharePointProjectItemModel">
Otros consejos
WebTemplate isn't allowed in Farm scoped features. See Elements by Scope even though it's for SP2010 it can be used as a guideline for SP2013.
The best you can do is WebApplications scope