locked
The specified list does not exist. RRS feed

  • Question

  • Hello ,

    • I have create a  project "EmptySharePointProject" .
    •  I create New Item "ListDefinition " and select the types "DocumentLibrary" . here it is the element.xml :

                  <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
                     <ListTemplate
                         Name="styleSheetListDefinition"
                         Type="10000"
                         BaseType="1"
                         OnQuickLaunch="TRUE"
                         SecurityBits="11"
                         Sequence="110"
                         DisplayName="styleSheetListDefinition"
                         Description="My List Definition"
                         Image="/_layouts/images/itdl.png"
                         DocumentTemplate="121"/>
                  </Elements>

     

    • The elememnt.xml  for the list instance is :

           <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
            <ListInstance Title="styleSheet"
                    OnQuickLaunch="TRUE"
                    TemplateType="10000"
                    Url="Lists/styleSheet"
                    Description="My List Instance">
           </ListInstance>
         </Elements>

     

    • I create new item  "Module " called "Styles" . And here it is the element.xml :

                <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
                  <Module Name="Styles" Url="styleSheet"> 
                  <File Path="Styles\simple.txt" Url="simple.txt" Type="GhostableInLibrary" /> 
                   </Module>
               </Elements>

     

    •  Then I open the feature designer and sort the items as the following : 
    1. StyleSheet (ListInstance) .
    2. StyleSheet(ListDefinition).
    3. Styles (Module).               
    • I deploy the project and When Activate the feature , I got the following error : "Failed to instantiate file "AltCore.css" from module "Styles": The specified list does not exist."

                     So what is the problem in my sample ?

            Thanks


    ASk
    • Moved by Clayton Cobb Saturday, May 14, 2011 8:15 PM Programming questions go in the programming forum (From:SharePoint 2010 - General Questions and Answers)
    Saturday, May 14, 2011 9:29 AM

Answers

  • Hello ,

      I know what the problem is  :

          <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
            <ListInstance Title="styleSheet"
                    OnQuickLaunch="TRUE"
                    TemplateType="10000"
                    Url="Lists/styleSheet"
                    Description="My List Instance">
           </ListInstance>
         </Elements>

     

    when  the list is created . it is created in this section "Document Libraries " . And when mouse over on this list you will see the url will be

                                   "http://server:portnumber/Lists/TestList/Forms/AllItems.aspx"

    And that is not correct . because it must be  "http://server:portnumber/TestList/Forms/AllItems.aspx" . so the element.xml will be :

      <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
            <ListInstance Title="styleSheet"
                    OnQuickLaunch="TRUE"
                    TemplateType="10000"
                    Description="My List Instance">
           </ListInstance>
         </Elements>

          thanks,


    ASk
    • Marked as answer by himo Sunday, May 15, 2011 9:51 AM
    Sunday, May 15, 2011 9:50 AM

All replies

  • Hi,

    where do you store AltCore.css ?

    in your Module you just have a text file .


    Sunday, May 15, 2011 4:43 AM
  • hello ,

    •   yes it is already found .

     

    • If create the DocumnetLibrary by code or create it from site  . the feature working fine and no error happened appear when activate the feature . When I use the previous way in my previous post , it is not working .

     

    sorry there is the error "Failed to instantiate file "sample,txt" from module "Styles": The specified list does not exist."


    ASk

    Sunday, May 15, 2011 8:29 AM
  • Hello ,

      I know what the problem is  :

          <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
            <ListInstance Title="styleSheet"
                    OnQuickLaunch="TRUE"
                    TemplateType="10000"
                    Url="Lists/styleSheet"
                    Description="My List Instance">
           </ListInstance>
         </Elements>

     

    when  the list is created . it is created in this section "Document Libraries " . And when mouse over on this list you will see the url will be

                                   "http://server:portnumber/Lists/TestList/Forms/AllItems.aspx"

    And that is not correct . because it must be  "http://server:portnumber/TestList/Forms/AllItems.aspx" . so the element.xml will be :

      <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
            <ListInstance Title="styleSheet"
                    OnQuickLaunch="TRUE"
                    TemplateType="10000"
                    Description="My List Instance">
           </ListInstance>
         </Elements>

          thanks,


    ASk
    • Marked as answer by himo Sunday, May 15, 2011 9:51 AM
    Sunday, May 15, 2011 9:50 AM