Treemap Gdip

Posted by: nzd on 4 September 2023, 11:44 pm EST

  • Posted 4 September 2023, 11:44 pm EST - Updated 4 September 2023, 11:51 pm 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, 5:54 am 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 6 September 2023, 10:12 pm 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 6 September 2023, 10:38 pm 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 6 September 2023, 11:17 pm 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, 2: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 7 September 2023, 5:52 pm EST - Updated 7 September 2023, 5:57 pm 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 7 September 2023, 9:51 pm 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 7 September 2023, 10:06 pm 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