MOSS and Solution deployment: Your Features folder is missing some files

Have you done nice Feature (or set of Features) that you want to deploy using SharePoint Solution deployment? Great. Have you already deployed your newly created solution? Great. Are you missing files from your features folder: TEMPLATES\FEATURES\YourCompany.YourFeatureName ? You only have two xml files there (one is Feature.xml and the other one is probably Elements.xml)... and you should have extra files like MyPage.aspx or similar in your folder? If this is your case then keep on reading!

First phase of creating solution package is to create your solution manifest.xml that will tell everything that's related to this solution package. Here is small example of solution with two features: site content types and eventhandlers.

<?xml version="1.0" encoding="utf-8" ?><solution xmlns="https://schemas.microsoft.com/sharepoint/"
  solutionid="477DB459-1EC9-4bcd-A56B-E7519F8F38F9">
  <featuremanifests>
    <featuremanifest location="MyCompany.SiteContentTypes\feature.xml">
    <featuremanifest location="MyCompany.EventHandlers\feature.xml">
  </featuremanifests>
  <assemblies>
    <assembly location="MyCompany.EventHandlers.dll"
              deploymenttarget="GlobalAssemblyCache">
  </assemblies>
</solution>

Then you want to create .wsp file (using MakeCab.exe [it can be found in here if you don't have one]) for your solution. And MakeCab needs .ddf file so that it knows what to put inside the package. Here is small example of .ddf file: 

.OPTION Explicit ; Generate errors .Set CabinetNameTemplate="MyOwnPackage.wsp" .Set DiskDirectoryTemplate=CDROM .Set CompressionType=MSZIP .Set UniqueFiles=Off .Set Cabinet=On .Set DiskDirectory1=Package ; ; \ ;************************************************** manifest.xml .Set DestinationDir="MyCompany.EventHandlers" "MyCompany.EventHandlers\Feature.xml" "MyCompany.EventHandlers\EventHandlers.xml" .Set DestinationDir="MyCompany.SiteContentTypes" "MyCompany.SiteContentTypes\Feature.xml" "MyCompany.SiteContentTypes\contenttype.xml" "MyCompany.SiteContentTypes\Templates\MyDoc.docx"

Then you run: MakeCab.exe /f MyOwn.ddf
It gives you MyOwnPackage.wsp.

Second phase is to install the newly created file. You can use STSADM.EXE for that. Here's an example:

@SET SPDIR="c:\program files\common files\microsoft shared\web server extensions\12" %SPDIR%\bin\stsadm -o addsolution -filename MyOwnPackage.wsp %SPDIR%\bin\stsadm -o deploysolution -name MyOwnPackage.wsp                    -immediate -allowGacDeployment

So now you should have fully deployed solution in your SharePoint. Now if go to your feature folder (in this case: MyCompany.SiteContentTypes) you should have MyDoc.docx in there. But if it's not there... you should check your features Feature.xml one more time. Let's check out the example that fixes the problem:

<?xml version="1.0" encoding="utf-8" ?>``<feature id="5F1E0311-C2BD-40f6-A65E-06FA1047B5E0"
  title="MyCompany Site Contenttypes"
  xmlns="https://schemas.microsoft.com/sharepoint/" 
  scope="Site"   version="1.0.0.0"   description="MyCompany Site Contenttypes">  <elementmanifests>
    <elementmanifest location="contenttype.xml">
    <elementfile location="MyDoc.docx"> <!-- IMPORTANT! -->
  </elementmanifests>
</feature>

You should notice that there is elementfile that defines the location of MyDoc.docx. If you DON'T have this defined, ShapePoint will ignore that file even if it's inside the .wsp file. So it just means, that even if you put a lot of stuff into your solution package you still need to define the files in your feature files.

I hope this makes sense to someone with this kind of problem.

Anyways... happy hacking!

J