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

Free Support Forum - aspose.com

Bug in Aspose.Cells for .net core (setting worksheet’s “Name” property causes "null reference" exception)

Hello! We found bug in Cells for .Net Core (no problem for old .net framework).

The bug is: setting or changing Worksheet’s “Name” property in aspose.cells for .net core throws “null reference” exception.


myBook.Worksheets.Add(“abc”); //throws null reference exception.

myWorksheet.Name = “abc”; //throws null reference exception (“myWorksheet” is a valid instance).

Please, address this issue ASAP,

Thank you very much,


Hi @gurariy
Based on your code, I made a sample project and found no problems.
Please try it and share your environment with us.
You can also modify the project to reproduce this issue and share it with us. Thank you.
TestNetCore.zip (14.8 KB)

Hello Leo,

This bug happens when you create the new instance of the Workbook not from “nothing”, but from existing Excel file. I’m sending you back via attachment your own example, but now slightly modified. I copied to the exe folder file test.xlsx and created new instance of the workbook, passing name of this test.xlsx file into the constructor. Now you will see the “null reference” error when you try to add new worksheet by name or change the Name property of existing worksheet. This error does not exist in Aspose for .Net Framework, but DOES EXIST in Aspose for .Net Core.

Thank you very much,

Alex Gurariy

TestNetCore.zip (5.86 MB)

Hi @gurariy
I have logged a ticket with an id “CELLSNETCORE-301” for this issue. We will look into it soon.
Once we have an update on it, we will let you know.

Thank you very much.
Just one additional info: I found that not all Excel files initializing Workbook with, break its Worksheet’s Name property, but “some”. I’m not sure what exactly has to be in the file to cause the issue. File test.xlsx I sent you is a good example where Name property is broken.

Thank you,

Alex Gurariy

Yes, the file you provided is very useful to help locate the problem, thank you.
We’ll solve it, the next patch takes effect.

Hi @gurariy
Please try Aspose.Cells21.11.7 For .NetStandard20.
Aspose.Cells21.11.7 For .NetStandard20.Zip (5.6 MB)

Thank you very much! It works!

Do you know when approximately Aspose is going to release next official update via NuGet that will include this fix? I’m asking, because in our .net core projects we do not use individual assembly references, but instead we use NuGet packages.

Thank you again,

Alex Gurariy

Hi @gurariy
Glad to know that the issue has been solved.
The official version will be released once a month, and the next one will be released within 10-15 days. Thank you.

The issues you have found earlier (filed as CELLSNETCORE-301) have been fixed in this update. This message was posted using Bugs notification tool by simon.zhao

Hi @gurariy
Aspose.Cells 21.12 already released, you can get it directly from the nuget package installer now.

Thank you VERY MUCH!!!


You are welcome.