Treemap Gdip

Posted by: nzd on 5 September 2023, 8:44 am EST

  • Posted 5 September 2023, 8:44 am EST - Updated 5 September 2023, 8:51 am EST

    Hello,

    What to do about this error?

    I know I can install “libgdiplus” on the host machine, but is this really necessary, is there anything else to do about it?

    Two different environments:

    1. Docker dekstop Mac Mini M1
    2. Azure kubernetes Ubuntu
  • Posted 6 September 2023, 2:54 pm EST

    Hi,

    Thank you for reporting the issue. We are able to replicate the issue with the Linux container and it has been forwarded to the concerned team with the internal tracking ID C1XAML-34965.

    We will let you know as we get an update on this.

    Regards,

    Manish Gupta

  • Posted 7 September 2023, 7:12 am EST

    Hello again,

    It’s probably related to the System.Drawing .NET 7 depreciation:

    https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/7.0/system-drawing#old-behavior

    Regards,

    Nikolas

  • Posted 7 September 2023, 7:38 am EST

    Hello Nikolas,

    Yes, you are correct, the Syste,.Drawing.Common support has been ended for non-windows OS by MS.

    The detailed information can be found here:

    https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only#reason-for-change

    So you may use the suggested workaround https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only#recommended-action or install libgdi library:

    # install libgdiplus
    RUN apt-get update && apt-get install -y libgdiplus


    Hope it helps!

    Regards,

    Manish Gupta

  • Posted 7 September 2023, 8:17 am EST

    Hello,

    The workaround you linked only applies to .NET 6, but we are using 7. So I will need using libgdi library, but I would also like not to install it later on.

    Regards,

    Nikolas

  • Posted 7 September 2023, 11:46 pm EST

    Hello Nikolas,

    Along with installing the libgdiplus library, we also need to add the file runtimeconfig.template.json to the root of the project with the following content:

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


    Please refer to the attached sample for reference:

    TreeMap_docker.zip

    Regards,

    Manish Gupta

  • Posted 8 September 2023, 2:52 am EST - Updated 8 September 2023, 2:57 am EST

    Hello Manish,

    That’s what we have been doing for .NET 6, but we are now running .NET 7. Please see attached image of .NET 7 MS documentation, and link if needed.

    https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/7.0/system-drawing#new-behavior

    Regards,

    Nikolas

  • Posted 8 September 2023, 6:51 am EST

    Hello Nikolas,

    The sample shared previously is created using NET 7.0 and executed on Linux Docker and it works fine.

    It uses the JSON file along with installing the libgdiplus library. Also, the team is trying to find an alternative for the System.Drawing.Common library but we are not sure how much time it would take to complete this research and implementation.

    Regards,

    Manish Gupta

  • Posted 8 September 2023, 7:06 am EST

    Hello Manish,

    Thanks, I’ll try.

    And please let me know when there is anything new.

    Regards,

    Nikolas

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels