Getting error "System.Drawing.Common" is not supported in non-Windows Platforms


We are getting the following error in Apose Total :
“System.Drawing.Common” is not supported in non-Windows Platforms

image.jpg (32.1 KB)


Thanks for the screenshot.

Could you please elaborate and provide more details about the issue, which Aspose for .NET APIs you are using? Also, share your complete environment details (OS, .NET framework version, other settings, etc.), sample code and sample file(s) to reproduce the issue. We will check and assist you accordingly.

PS. please zip the files prior attaching.


We are working on two approaches. I am attaching code snippets for both the approaches

  1. Direct license name
  2. License file as a stream.

We are using the license “Aspose.Total.NET.LIC”, in our application. And our application is hosted on azure LinuxCode (822 Bytes)


Could you please turn on the runtime config switch “EnableUnixSupport” to support the drawing feature if you are using .NET 6 on non-windows platforms. For more information please refer to and follow up Microsoft’s official statement. Also see another document for further reference.

Please note, Aspose.Cells Team is working on the Graphics Library migration, and will use SkiaSharp to complete the migration in the future, as recommended in official statement of Microsoft.

Hi Amjad,

We tried both the approaches mentioned by you but still getting same error.

    1. Updated the runtime switch :- (turn on the runtime config switch “EnableUnixSupport” to support the drawing feature if you are using .NET 6 on non-windows platforms.)
    1. Also tried with the approach as suggested in

Can you please suggest anything else that we can try to resolve this?


We are sorry that the suggested workaround does not fix your issue. I am afraid, at the moment there is no other reliable workaround that you can try to cope with it.

By the way, I spotted you are doing auto-fitting operation and setting cells width in your code. The error might be due to these features/tasks. So, you may try to remove or comment out the line regarding auto-fit cols/rows operation if it works now. Alternatively, you may try to comment out both the lines:

sheet.Cells.StandardWidth = 20.5;  

Hi @MaheshChegu
Please confirm system.drawing.common can run properly, such as:

        Bitmap image = new Bitmap(100, 100);
        Graphics g = Graphics.FromImage(image);

Can you run above code successful in your Azure environment? (just refer to system.drawing.common)

And, If it is indeed the exception like (“System.Drawing.Common” is not supported in non-Windows Platforms), it is the only solution currently available in net6 using system.drawing.common, as recommended by Microsoft.


We have followed the approach as suggested in below link and closed it.

.NET 6 System.Drawing.Common Runtime Switch - Stack Overflow.

Thanks for your support.

Hi @Amjad_Sahi,
Was this the reason for Aspose to have dependencies to SkiaSharp?, and are we expected to see this going forward if we are using the latest version of Aspose?


Yes, System.Drawing.Common is not working on non-windows platform with .Net 6 and above by default. And System.Drawing.Common works poorly on non-windows platform.

In the latest version of Aspose.Cells, we switched to SkiaSharp for .Net 6 and above. see document Run Aspose.Cells for .Net6 on Linux.

Nice, thank you. Now it makes sense. Good work team.


You are welcome.