Getting error while Using Autofit in Excel

Hi team,
Here is my code snippest.

>  if (worksheet.Cells.Count > 0)
>  {
> 
>      Aspose.Cells.Range sourceRange = worksheet.Cells.MaxDisplayRange;
>      //Create a range with same row and column count as source worksheet
>      Aspose.Cells.Range destRange = FAQ.Cells.CreateRange(sourceRange.FirstRow, sourceRange.FirstColumn, sourceRange.RowCount, sourceRange.ColumnCount);
>      //Select Paste Options
>      PasteOptions options = new PasteOptions();
>      options.PasteType = PasteType.Values;
>      //Copy the range from source worksheet to destination.
>      destRange.Copy(sourceRange, options);
>      destRange.ColumnWidth = 60;
>    destRange.Worksheet.AutoFitColumn(0);
>    destRange.Worksheet.AutoFitColumn(1);
>  }

This code work properly at my local windows machine but when I deploy this code on server which is on Linux that time it’s giving me this error at this line.

destRange.Worksheet.AutoFitColumn(0);
destRange.Worksheet.AutoFitColumn(1);

Here is my error

"The type initializer for ‘\u000e\u0003\u000f\u0002’ threw an exception. at \u000e\u0003\u000f\u0002.\u000e\u0005(String \u0002, Single \u0003, FontStyle \u0005)\n at \u0005\u0016\u0010\u0003.\u0006\u0005(String \u0002, Font \u0003, Double \u0005)\n at \u0006\u0019\u0005.\u0002\u0003(Int32 \u0002, Int32 \u0003, Int32 \u0005, Int32 \b, AutoFitterOptions \u0006)\n at \u0006\u0019\u0005.\b(Cells \u0002, Int32 \u0003, Int32 \u0005, Int32 \b, Int32 \u0006, AutoFitterOptions \u000e)\n at Aspose.Cells.Worksheet.AutoFitColumn(Int32 columnIndex)\n "

I’m using Aspose cells 23.0 netstandard2.0 dll for .NetCore 8 project.
Is there any dependency file or other version of file I have to upload on my Linux server.

@Jayshiv
1,Please install libgdiplus if you use netstandard2.0 on linux server.
How to Run Aspose.Cells in Docker|Documentation

2,Please try Aspose cells for Net6 or above Net version.

There are some issues about libgdiplus ,so we used SkiaSharp as Drawing sdk in Net6 and above Net version on Linux server.

ok. I’ll check .
Thanks For your quick response.

@Jayshiv,

Sure, please take your time to try using Aspose.Cells library of .NET6.0 or above version for your scenario/case. Let us know if you find any issue.