Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Directory

I am trying to create a custom list feature, what I did is created feature and then i build a solution out of it using this tutorial

Creating a Solution file for Feature

when it creates a .wsp file for the feature, it includes, manifest, and then a folder containing feature.xml, element.xml and then a sub folder containing schema.xml.

Now when I add and deploy the solution using STSADM commands, what it does is creates a folder in 12 hive and only copies feature.xml and elements.xml in it, not the schema.xml (In result when i try to create the list using this feature, it gives me ERROR: Exception from HRESULT: 0x81070201 which means its not finding the schema.xml)

Now if i copy the files of this feature and just change the names and the GUID ids, and copy the folder in 12Hive features manually & using "Install feature" instead of adding and deploying the feature, it works perfectly.

Now the problem comes somewhere when it deploys the .wsp file i cant blame the tutorial as when it creates the .wsp file it contains all the necessary files required.

If i post the code this question will be too long, so ask me if you need anything,

Cheers

Feature.xml

<?xml  version="1.0" encoding="utf-8"?>
<Feature 
Title="YourFeature" 
Description="YourFeature" 
Id="GUID" 
Scope="Site" 
Version="1.0.0.0" 
Hidden="FALSE"
DefaultResourceFile="core"
xmlns="http://schemas.microsoft.com/sharepoint/">
  <ElementManifests>
    <ElementManifest Location="elements.xml" />
  </ElementManifests>
</Feature>

Manifest

<?xml version="1.0" encoding="utf-8"?>
<Solution xmlns="http://schemas.microsoft.com/sharepoint/" 
          SolutionId="GUID" >
  <FeatureManifests>
    <FeatureManifest Location="YourFeature\Feature.xml"/>
  </FeatureManifests>
</Solution>

elements.xml

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListTemplate Name="YourFeature"
                DisplayName="YourFeature"
                Description="YourFeature"
                Type="11006"
                BaseType="0"
                OnQuickLaunch="FALSE"
                SecurityBits="11" />
</Elements>

wsp.ddf

.OPTION Explicit
.Set DiskDirectory1="..\YourFeature"
.Set CabinetNameTemplate="YourFeature.wsp"

manifest.xml

; These directory names (DestinationDir) are used for the folders creation under 12\TEMPLATE\Features

.Set DestinationDir="YourFeature"
elements.xml

.Set DestinationDir="YourFeature\YourFeature"
YourFeature\schema.xml

.Set DestinationDir="YourFeature"
Feature.xml

a bit of schema file code

<?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint"  Name="YourFeature" Title="YourFeature" Description="" Direction="" Url="" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
    <MetaData>  
        <Fields>....... (too long to be posted)
share|improve this question
1  
you do not need to post everything, but you should at least post the contents of your feature.xml and possibly the manifest. Also, if you change the extension of your wsp to cab, can you confirm that the schema.xml is in the proper folder within your solution package? –  Rich Bennema Mar 14 '12 at 14:09
    
Yes the schema.xml is in a folder named as listtemplate name in elements.xml –  Muhammad Raja Mar 14 '12 at 14:20
add comment

2 Answers 2

up vote 2 down vote accepted

You are missing the ElementFile element. From what you've described, your feature.xml should look something like this:

<?xml  version="1.0" encoding="utf-8"?>
<Feature 
Title="YourFeature" 
Description="YourFeature" 
Id="GUID" 
Scope="Site" 
Version="1.0.0.0" 
Hidden="FALSE"
DefaultResourceFile="core"
xmlns="http://schemas.microsoft.com/sharepoint/">
  <ElementManifests>
    <ElementManifest Location="elements.xml" />
    <ElementFile Location="YourFeature\schema.xml" />
  </ElementManifests>
</Feature>

The schema.xml should be in a folder named YourFeature. Also, the folder that contains schema.xml must be the same as the value of the Name attribute in your elements.xml.

share|improve this answer
    
I already checked all these necessary things like names of folder and Name of folder containing schema.xml must be same as ListTemplate attribute in my elements.xml, so thats definitely not the case here. –  Muhammad Raja Mar 14 '12 at 14:28
    
I changed the folder directory from that Tutorial, sorry forgot to mention –  Muhammad Raja Mar 14 '12 at 14:47
1  
I've edited my answer to reflect your comment. So schema.xml is in the Tutorial directory, right? Did adding the ElementFile element to your feature.xml and rebuilding your wsp file fix your problem? –  Rich Bennema Mar 14 '12 at 14:52
1  
Based on your edits to the question, I've updated the feature.xml in my answer. It isn't a matter of "even tried." It will not work otherwise. As you have discovered, you do not need the ElementFile element if you manually copy the files to the 12 hive. But if you are deploying the feature in a solution package, then the ElementFile element is required. Make sure it is there, then rebuild your wsp. Change the extension from wsp to cab and make sure schema.xml is in the appropriate directory and that feature.xml is correct. Then retract/deploy your wsp on the server. –  Rich Bennema Mar 14 '12 at 16:06
1  
Thanks Alot, i Referenced forms as well and now its all working fine, I remember I did tried it before, but still credit goes to you, Cheers :) ! –  Muhammad Raja Mar 14 '12 at 17:19
show 3 more comments

I would check your ddf file. Here is the preview from one of my projects

;.OPTION Explicit
.Set CabinetNameTemplate="Test.wsp"
.Set DiskDirectoryTemplate="..\TargetFolderForWsp(bin)"
.Set CompressionType=MSZIP
.Set UniqueFiles=Off
.Set Cabinet=On

;*******************************

manifest.xml
%BuildPath%\Test.dll Test.dll
.Set DestinationDir="FeatureName"
12\TEMPLATE\FEATURES\FeatureName\feature.xml feature.xml
12\TEMPLATE\FEATURES\FeatureName\SiteColumns.xml SiteColumns.xml
12\TEMPLATE\FEATURES\FeatureName\ContentTypes.xml ContentTypes.xml
12\TEMPLATE\FEATURES\FeatureName\ListTemplateName\ListDefinition.xml ListTemplateName\ListDefinition.xml
12\TEMPLATE\FEATURES\FeatureName\ListTemplateName\Schema.xml ListTemplateName\Schema.xml
12\TEMPLATE\FEATURES\FeatureName\ListTemplateName\AllItems.aspx ListTemplateName\AllItems.aspx
12\TEMPLATE\FEATURES\FeatureName\ListTemplateName\DispForm.aspx ListTemplateName\DispForm.aspx
12\TEMPLATE\FEATURES\FeatureName\ListTemplateName\EditForm.aspx ListTemplateName\EditForm.aspx
12\TEMPLATE\FEATURES\FeatureName\ListTemplateName\NewForm.aspx ListTemplateName\NewForm.aspx

The first path is path to file in project (Replace with you file path) The second path is the package location reltaive to the DestinationDir specified above

share|improve this answer
    
Defiantly there is some problem with my ddf file, but when it creates the WSP file , schema is in it (in a subfolder) , well confusing ! –  Muhammad Raja Mar 14 '12 at 15:36
add comment

Your Answer

 
discard

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

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