# Web Part Feature

I'm working on a (non-visual) Web Part and wish to read from an xml file placed in the "C:\inetpub\wwwroot\wss\VirtualDirectories\80\wpresources" folder:

Code-Behind:

string sUri = @"C:\inetpub\wwwroot\wss\VirtualDirectories\80" + @"\wpresources\links.xml";


Can someone help me with the correct syntax for the Feature.xml to include this XML file when deploying the Feature?

UPDATE 10-08-2012:

Tried adding links.xml to same location as the Web Part and got following error:

Elements.xml:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
Type="GhostableInLibrary">
<Property Name="Group" Value="Custom" />
</File>
Type="GhostableInLibrary" />
</Module>
</Elements>


Feature1.Template.xml:

<?xml version="1.0" encoding="utf-8" ?>
<Feature Id="4BB4B62C-4F2F-4BB5-A477-DF783B802DD5"
Scope="Site"
Version="1.0.0.0"
Hidden="FALSE"
DefaultResourceFile="core"
xmlns="http://schemas.microsoft.com/sharepoint/">

<ElementManifests>
</ElementManifests>
</Feature>

• why don't add this file to your feature code and deploy it as a solution if its only going to be used by feature ? – Mathematics Oct 2 '12 at 21:56
• Could you give me the syntax for that in an answer, URL, PATH, etc? I had difficulty configuring it like this... – IrishChieftain Oct 2 '12 at 21:58
• @yaron, updating question – IrishChieftain Oct 2 '12 at 22:16
• code you entered is for "element.xml" not feature.xml – Mathematics Oct 2 '12 at 22:26

You can try WSP builder to develop a solution file and include this xml file within your solution but that will be case only if this file is there to be used by this feature only.

http://wspbuilder.codeplex.com/

hope it helps :)

Edit

<ElementManifest Location="links.xml" />


so it will be something like this

<Feature
Title="Title"
Description="sssss"
Id="ID"
Scope="Site"
Version="1.0.0.0"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
</ElementManifests>
</Feature>


EDIT 2

Try this

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
Type="GhostableInLibrary">
<Property Name="Group" Value="Custom" />
</File>