I am using EPPlus to generate an XLSX file in C#. As soon as I instantiate the ExcelPackage with a memory stream - I get the error:
\"A disk error occ
It looks like you're hitting a bug in the error handler of the ExcelPackage constructor. If you try and give it an empty stream, System.IO.Packaging.Package.Open
raises an exception indication that a package cannot be empty.
This code works, even if the file doesn't exist:
var file = new FileInfo("test.xlsx");
using (ExcelPackage package = new ExcelPackage(file))
{
}
Given that the documentation for the constructor overload indicates that the stream is allowed to be empty, I'd recommend raising this issue in the EPPlus issue tracker.