Adding files to a feature directory

The other day I had the following error:

Error occurred in deployment step 'Add Solution': Error: Cannot find this file specified in the manifest file: BrandProject_Feature1\addtheme.xml

The feature I had created required an xml file so in the feature1.template.xml file I had the following manifest code:

  <ElementManifests>
    <ElementFile Location="addtheme.xml" />
  </ElementManifests>

However I was having trouble adding a file to the features directory. (BrandProject_feature1). I was getting the above error and deployment was not working so I had to google round for a solution.

The solution, although not obvious, is fairly simple. (Thanks to Henry Chong for pointing me in the right direction)

Step 1: Create a new Empty element in your project.

Delete the Elements.xml file that the new empty element creates, then add your other files to the empty element.

Step 2: Alter Element file properties

For each file in the element, make sure its deployment type is set to "ElementFile" and its Deployment Location path is set to nothing. This will cause the element files to be added to the root of the feature it is added to.

Step 3: Deploy

Now when you test deploy your solution you should not have the error appearing anymore.

 

Help my beer fund

RocketTheme Joomla Templates