views:

1173

answers:

3

I am building a SharePoint Feature to deploy a simple WebPart and a custom list within the "Web" scope.

  1. When the solution is deployed my list is immediately available in Site Actions -> Site Settings -> Custom Lists.
  2. If you try and create an instance of the list I receive "File Not Found"
  3. If you activate the feature a second copy of the list template is added to the Custom Lists heading.
  4. Neither list can be created with the same "File Not Found" error
  5. On deactivating the feature one list template disappears
  6. On retracting the solution the last list template disappears

Files Involved:

  • schema.xml is 5000 lines long
  • feature.xml is as follows

    <?xml version="1.0" encoding="utf-8"?>
    <Feature Id="78a8eaad-2160-434c-81c2-6c5f7ce94ade" Title="WeekWidget" Description="Displays A, B or H based upon a configurable SharePoint List." Version="1.0.0.0" Creator="Cardinal Newman Catholic School // Richard Slater" Scope="Web" ImageUrl="WeekWidget\WeekWidgetLogo.jpg" xmlns="http://schemas.microsoft.com/sharepoint/&amp;quot; DefaultResourceFile="core">
    <ElementManifests>
    <ElementManifest Location="ListTemplates\WeekCalendar.xml" />
    <ElementFile Location="WeekCalendar\Schema.xml" />
    </ElementManifests>
    </Feature>

  • WeekCalendar.xml is as follows

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/&quot;&amp;gt;
    <ListTemplate Name="WeekCalendar" DisplayName="Week Calendar" Description="List of Weeks." BaseType="0" Type="100" OnQuickLaunch="TRUE" SecurityBits="11" Sequence="410" Image="/_layouts/images/itgen.gif" />
    </Elements>

I think the "File Not Found" error is symptomatic of another problem, however the addition of the list template shouldn't happen on solution deployment. What am I doing wrong?

A: 

Could you post your CAML files defining your list?

-Ash

Ash
Its over 5000 lines long, I have posted the XML I can above.
Richard Slater
A: 

are you wiring up all of the feature files yourself or using a tool? typically, the 404 means one of the 'magic strings' in your configuration files is off. Also, the directory structure specified here looks suspicious:

<ElementManifests>
  <ElementManifest Location="ListTemplates\WeekCalendar.xml" />
  <ElementFile Location="WeekCalendar\Schema.xml" />
</ElementManifests>

You should try deploying all of your feature support files to the same directory. Have you located the error in the ULS log (<12 hive>/LOGS)? That may provide some clues too.

Jason
I am using STSDev 2008 and Visual Studio 2008 to deploy the feature, it was suggested to me that seperating out the files in to directories was good practice, so I copied the layout from Microsoft's CustomList feature.
Richard Slater
in my experience i've had similar diffculties when trying to deploy features to multiple directries like this. have you checked the logs?
Jason
A: 

I think the problem could be related to the separate directory structure--I usually deploy all list files to the same folder (schema.xml and weekcalendar.xml, in your case; keep feature.xml out of the list directory).

Turn on verbose logging and check the 12-hive logs to see what file is not found.

Check schema.xml and ensure the name attribute on the list element matches the name of the folder housing your feature. Also watch out for the Url attribute on this element... VSeWSS will set the URL to the name of the list being reverse engineered so I change it to "pages\viewpage.axp".

On the default view element within schema.xml, try adding SetupPath="pages\viewpage.aspx". Ensure there's a WebPartZoneId="Main" attribute on there as well.