Free Support Forum -

Aspose.cells throws System.TypeLoadException. Could not load type 'System.Drawing.FontStyle' in .net core 2.0'

Hi Support,

I am trying to read a csv file using apose.cells for .net core 2.0 with the code below:

        TxtLoadOptions opts = new TxtLoadOptions(LoadFormat.CSV);
        Workbook wb = new Workbook(@"D:\POCS\Import-Export\Database import.csv", opts);
        Worksheet ws = wb.Worksheets[wb.Worksheets.ActiveSheetIndex];
        Row row = ws.Cells.GetRow(0);

and I get the following exception :
image.png (5.8 KB)

Does Apose.cells support .net core 2.0?Please let me know your answer when you have time.

Best regards,
Luis F. Camacho


We were able to observe the issue and it is related to latest v18.9.0 only. You may please try it using v18.8.0, for which this code works fine. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNETCORE-11 - Exception "Could not load type 'System.Drawing.FontStyle' from assembly 'System.Drawing" while loading CSV


We are checking this problem. In the meanwhile, we suggest you to download “” from this link:

Using Aspose.Cells.dll in “lib/netstandard20_AuthenticodeSigned” folder, you may add Aspose.Cells.dll to your .NetCore project reference manully.
Then you need to add System.Drawing.Common and System.Text.Encoding.CodePages form Nuget manually.

Try the steps mentioned above and let us know your feedback.

HI @ahsaniqbalsidiqui

thanks for answering the question the steps that you suggested works as expected.

Again , thanks you very much for finding a solution for that and have a good day .

best regards,
Luis F. Camacho


Good to know that your issue is sorted out by the suggested steps. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.


Please download Aspose.Cells 18.11.0 from NuGet, this problem has been fixed.

Let us know your feedback