问题
ZipArchive archive = ZipFile.Open("test.xlsx", ZipArchiveMode.Update);
archive.Dispose();
This simplest operation turns test.xlsx into corrupted file, so Excel can't open it. Later if I manually extract all files from corrupted test.xlsx and zip them back, file becomes good again for Excel.
I need to do some changes in xlsx from my code by unpacking some XMLs and modifying them. How to stop file corruption by ZipArchive?
来源:https://stackoverflow.com/questions/58433045/how-to-prevent-system-io-compression-ziparchive-from-corrupting-xlsx-file