Search code examples
c#asp.net-mvcexcelepplusepplus-4

EPPLus Error when loading a Stream larger than 40MB


I am using EPPlus on C# MVC to load excel files into memory. I am taking the stream from a file upload:

model.File.InputStream

and pass this to the ExcelPackage.Load() Method.

It works great for files < 40 MB. But for larger files, I get the error:

An exception of type 'System.Runtime.InteropServices.COMException' occurred in EPPlus.dll but was not handled in user code

Additional information: A disk error occurred during a write operation. (Exception from HRESULT: 0x8003001D (STG_E_WRITEFAULT))

enter image description here


Solution

  • Switching the project to x64 fixed the issue!

    • If you're using this on IIS you have to set the pool to run on x64.
    • On IIS Express you have to Enable x64 bit version