Friday, September 28, 2007

Creating features using the ElementFile node

Andrew Connell (one of the best known SharePoint MVP's around) has posted an article about using the, rather unknown, ElementFile node in which you can specify which files are included in your custom feature definition. So why do you wan to do this you might wonder.. well.. read the following snippet

When you package everything up in a WSS solution package you list your Feature's definition file within the manifest.xml file (using the <FeatureManifests /> node) which contain the instructions to SharePoint of what to do with the files within the package (*.wsp). If you have additional files that go along with your Feature, you should be listing them in the manifest.xml file as well using something like <TemplateFiles /> or <RootFiles /> (the former is preferred). But, if you listed all the files that were part of the Feature using the <ElementFile /> nodes within the Feature definition, you wouldn't have to list them here. Why? Because SharePoint will look at the definition and see those are files that are part of the Feature itself so the solution framework will deploy those as well.

Read the whole article including a sample how your feature.xml will look like if you use this approach here : Using the ElementFile node in Feature definitions saves you in the deployment 

 

Btw if you are unsure how to build your own feature and/or solution package, read the following articles which I found very useful:

 

Technorati tags: ,

1 comment:

digital signatures said...

Excellent! Thanks for this - I've been looking at this feature for ages. Followed your instructions and it works a treat!