2

I have developed a custom Web Template based on "BDR#0" in SP 2013. It works perfect and I can deploy it using Site scope feature. The web template is developed by adding a Module in VS 2012 which includes Elements.xml and ONET.xml files as seen below:

enter image description here

I want to deploy web Template at Farm scope, But When I deploy using Farm scope feature, it gives following error:

Project Item "DCWebTemplate" cannot be deployed through a Feature with Farm scope. Whats wrong ?

4

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">
3

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.