I'm working on a library to treat specific sections of ODT files as Razor templates for a mini reporting engine. It unzips the odt and modifies content.xml, with what appear to be correct results, but the re-zipped file gives me a "general I/O error" when I try to open in it LibreOffice.
Currently I am using C#'s ZipFile.CreateFromDirectory() method to create the zip file. Do I need to do something special in terms of zipping the files together, or is it more likely that my mistake is somewhere else?
Obviously I first thought to check the mimetype file. I have confirmed that treating the group of files as a single zip archive without compressing them (compressionlevel.none) does not work, giving the same error. I surmise this might be because the mimetype file must be the first file in the archive. Is this really the issue and what can I do better?