I'm not entirely sure this is a bug, but since it's about code that worked in previous versions and doesn't work now, I thought creating an issue was the appropriate course of action.
This code, which worked in previous versions (before the switch to DotNetZip) is now broken:
```
using (var templateStream = File.OpenRead(TEMPLATE_PATH))
using (var outStream = File.Open(OUTPUT_PATH, FileMode.Create, FileAccess.ReadWrite, FileShare.None))
using (var package = new ExcelPackage(outStream, templateStream))
{
// Create more content
package.Save();
}
```
The output file is created, but it's an exact copy of the template file. The new file contents are written to a memory stream which gets discarded right away.
Luckily, the following (almost equivalent) code works:
```
using (var package = new ExcelPackage(new FileInfo(OUTPUT_PATH), new FileInfo(TEMPLATE_PATH)))
{
// Create more content
package.Save();
}
```
The problem seems to lie in ExcelPackage.Save, which does not copy the memory stream resulting from _package.Save() to its output stream if it wasn't initialized with a file. This does not look like intended behavior; more like unfinished work, IMHO.
Comments: I too am having an issue with memory streams. It used to work without even supplying a template using the ExcelPackage constructor with just the stream argument.