Suggested change for WSPBuilder

Jul 28, 2007 at 11:21 AM
Hey,
First - What a great project! After two weeks of VSeWss nightmare, this is such a releif and a real pleasure to use.
Anyway, When the feature.xml file is processed, WspBuilder assumes that a manafest file entry exists which is not always the case for sites, jobs or features that simply include dependecy features. I pulled your code and updated this method and it solved the problem. Please consider it as a possible update to WSPBuilder.

Thanks forsharing your project !!
Bruce VB

private List<string> GetElementFiles(FileInfo featureFile, DirectoryInfo childDir)
{
List<string> elements = new List<string>();
FeatureDefinition featureDef = null;
XmlSerializer xmlSerial = new XmlSerializer(typeof(FeatureDefinition));

// Always add the feature.xml file to the list
elements.Add(childDir.Name + @"\" + featureFile.Name);

using (FileStream fs = featureFile.OpenRead())
{
featureDef = (FeatureDefinition)xmlSerial.Deserialize(fs);
if (featureDef.ElementManifests != null && featureDef.ElementManifests.Items != null && featureDef.ElementManifests.Items.GetLength(0)==0)
{
foreach (ElementManifestReference element in featureDef.ElementManifests.Items)
{
elements.Add(childDir.Name + @"\" + element.Location);
}
}
else
{
Console.WriteLine("! Warning - <ElementManifests> xml element in feature.xml is not defined or is empty!");
}


fs.Close();
}

return elements;
}
Coordinator
Jul 30, 2007 at 10:58 PM
Thank you for your "update", it will be added to the next release of WSPBuilder.