Cross-cutting Tip #3
You cannot unzip a solution and pack it back
A solution zip and an unpacked solution are different shapes on disk. The packer refuses the zip's shape, naming a file that is sitting right there.
The zip you import is not the folder you edit. Inside the package a solution is four members at the top
level: solution.xml, customizations.xml, [Content_Types].xml, and a WebResources folder whose
files are named after their logical name with the dot removed and the component’s GUID glued on.
pac solution pack will not touch that shape.
Try the obvious thing - unzip the package, point the packer at the folder you just made - and this is what you get:
Error: Cannot find required file '.../plain/Other/Customizations.xml'.
customizations.xml was sitting in the folder you just named. The packer was looking one level
lower, for Other/Customizations.xml, with Other/Solution.xml beside it - because the folder it
accepts is the one pac solution unpack writes, not the one a zip contains. Unpack the same package and
you get nine files: components under Entities/ with their forms and RibbonDiff.xml, the app module
and its site map under AppModules/ and AppModuleSiteMaps/, web resources under WebResources/ with
their real extensions and a .data.xml sidecar each, and the two XML files under Other/.
Four members in the package, nine files on disk, and the resource that had no extension at all is now a
.js file with a .data.xml sidecar beside it. So the working folder is
always pac solution unpack, never unzip - and if your pipeline unzips a solution to get at a web
resource, it is editing a folder that can never be packed back.
If solution.xml is sitting at the top of the folder you are about to pack, the packer is going to look
for the one under Other/ and fail on a file you can see.