SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a problem when I activate the feature on the subsite. I try to create a wsp package with the module and feature. In the module I have stp files (list templates).

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="">
    <Module Name="Module_Template" Url="_catalogs/lt">
        <File Path="Module_Template\Stp\myTemplate1.stp" Url="myTemplate1.stp" Type="GhostableInLibrary" IgnoreIfAlreadyExists="True">
            <Property Name="LanguageDisplay" Value="1033" />
        <File Path="Module_Template\Stp\myTemplate2.stp" Url="myTemplate2.stp" Type="GhostableInLibrary" IgnoreIfAlreadyExists="True">
            <Property Name="LanguageDisplay" Value="1033" />

There is my Feature.xml

  <Feature xmlns="" Title="MyFeature Install Modules" Id="1c68d642-89ad-49ee-bfe1-38aac06272ee" ReceiverAssembly="MyFeature, Version=, Culture=neutral, PublicKeyToken=1fea90db2a1bbfe5" ReceiverClass="MyFeature.Features.Feature1.Feature1EventReceiver" Scope="Web">
        <ElementManifest Location="Module_Template\Elements.xml" />
        <ElementFile Location="Module_Template\Stp\myTemplate1.stp" />
        <ElementFile Location="Module_Template\Stp\myTemplate2.stp" />

If I activate my feature on WebRootSite the files from module copy to List Templates correct. But if I activate the feature on subsite i get an exception:

threw an exception during activation: Failed to instantiate file "myTemplate1.stp" from module "Module_Template": The specified list does not exist.

If I add the property (to Module) RootWebOnly="True" there is no exception but the files do not copy to the List Templates on the server. What im doing wrong?

share|improve this question

migrated from Feb 21 '12 at 14:29

This question came from our site for professional and enthusiast programmers.

Off Topic for Stack Overflow. Ask this on SharePoint. – Kyle Trauberman Feb 21 '12 at 14:10

List template gallery (the url atribute of _catalogs/lt) is only available in the root web of the site collection. So you get an exception when the feature is activated in the subsite because it cannot find the specified list (http://sitename/subsitename/_catalogs/lt). The templates should be available across the site collection.

Change the feature scope to site and deploy again.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.