Skip to main content
A newer version of this page is available. .
All docs
V21.2

System.Drawing.Common is Supported on Windows Only

With the release of .NET 6, the System.Drawing.Common library is compatible with Windows only. See the following Microsoft documentation topic for more information: System.Drawing.Common only supported on Windows.

An application that is built for non-Windows platforms throws the following exception:

System.TypeInitializationException : The type initializer for 'Gdip' threw an exception.

This breaking change affects DevExpress Reporting as we use the System.Drawing.Common library to render reports.

Use one of the following options to fix this issue:

  • Replace the System.Drawing.Common library with the earlier version 5.0.3.

    Version 5.0.3 retains compatibility with Linux, MacOS, and other platforms. An application built for these platforms does not throw the exception described above. Note that Microsoft does not issue fixes for non-Windows bugs and vulnerabilities.

  • As a temporary workaround, enable the System.Drawing.EnableUnixSupport configuration property to prevent the exception above on non-Windows platforms:

    {
        "configProperties": {
            "System.Drawing.EnableUnixSupport": true
        }
    }
    

    Note that Microsoft plans to stop checking this configuration property in future releases. Once this change is implemented, applications that use System.Drawing.Common will always throw the exception above on non-Windows platforms.