We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Out of memory exception in IStreamProvider


I use Aspose.Cells for convection Excel files to HTML.
I use IStreamProvider.
Code example:

var opt = new Aspose.Cells.HtmlSaveOptions
ExportHiddenWorksheet = false,
HiddenColDisplayType = HtmlHiddenColDisplayType.Remove,
HiddenRowDisplayType = HtmlHiddenRowDisplayType.Remove,
ExportImagesAsBase64 = true,
StreamProvider = new StreamProvider()

internal class StreamProvider : IStreamProvider
public void CloseStream(StreamProviderOptions options)
public void InitStream(StreamProviderOptions options)
options.Stream = new MemoryStream();

The problem is that I can’t convert example.zip (279.0 KB)
because of OutOfMemoryException.
exception.png (76.4 KB)

The root cause is using of ExportImageAsBase64 parameter.
If We turn it off - exception is not fired.


Please try our latest version/fix: Aspose.Cells for .NET v21.10.1 (attached):
Aspose.Cells21.10.1 For .Net2_AuthenticodeSigned.Zip (5.6 MB)
Aspose.Cells21.10.1 For .Net4.0.Zip (5.6 MB)
Aspose.Cells21.10.1 For .NetStandard20.Zip (5.6 MB)

I have tested using your template file and sample code and it works fine. I do not get the exception.

I use version 21.9.0.
Maybe this problem in this version?


Yes, please try our latest version/fix as suggested and let us know your feedback.

Is this version (21.10.1) available in Nuget feed?
I can Install only v21.10.0.
Or you propose to use attached file in my production code?
When are you planning to release this version?


The fixes (including Aspose.Cells for .NET v21.10.1 (attached)) which are posted into the forums are fully test for QA and can be used in production server. It contains all the functionality of previous Aspose.Cells for .NET v21.10 (official release) plus new enhancements and fixes.

No, we only publish official releases once in a month on Downloads/Nuget repos.

The next official release, i.e., Aspose.Cells for .NET v21.11 is expected around the mid of November, 2021.

PS. you may also test Aspose.Cells for .NET v21.10 from Nuget repos. and it should work fine.

10.21 does not work. The error is reproduced.


Could you try Aspose.Cells for .NET v21.10.1 and let us know your feedback. I have tested using your template file and sample code and it works fine. I do not get the exception

Yes, This version works fine.


Great, so you may try it.
Alternatively, you may wait for the next official release of the product.

Could you please share this version as a Nuget package .Net Standard 2.0?


No, we can’t. Check my previous reply:

Could you please clarify the reason for the ** OutOfMemoryException **?
It is important to understand how many documents can have such a problem.


We evaluated your scenario/case using your template file and sample code with Aspose.Cells for .NET v21.10 and found your mentioned issue (“OutOfMemoryException”).

We are sorry but we might not clarify precisely on it. But one thing is sure that we enhanced HTML rendering (Excel to HTML conversion) module in recent fix (Aspose.Cells for .NET v21.10.1). That’s why the new fix works with your file.

We can only recommend you to try our latest version. If you still want the version to Download from Nuget repos., please wait until we publish our next official release of the product.