Ticket T1158591
Visible to All Users

PlatformNotSupportedException occurs when an XAF Blazor or Web API app explicitly adds the System.Drawing.Common 7.0 package (or the app references it via dependent packages indirectly)

created 2 years ago

Hi Guys,

while having not tested anything right now in this direction - is there an plan or current status about XAF supporting net7 on Linux?

DevExpress.Drawing Graphics Library — v22.2 Update — SkiaSharp for .NET 6/7 and Linux Support (CTP)

Show previous comments (7)
Dennis Garavsky (DevExpress) 2 years ago

    We are double-checking out internal tests for mistakes - we will update this ticket once we have updates, thanks.

    Dennis Garavsky (DevExpress) 2 years ago

      Hello, Noxe.

      Our DevExpress.Data and its dependencies like DevExpress.ExpressApp rely on System.Drawing.Common 5.0 for build.

      The version of the System.Drawing.Common used in your end apps fully depends on the packages you reference yourself. So, our sample https://github.com/DevExpress/XAF-Blazor-Kubernetes-example/blob/main/XAFContainerExample.Blazor.Server/XAFContainerExample.Blazor.Server.csproj operates fine under .NET 7 in Unix environments, because it references System.Drawing.Common 5.0 and no external/custom packages override this. Note that if you use Docker, you must install and use libgdiplus explicitly, because DevExpress.Drawing and Skia are not yet supported in v23.1 and older:

      Code
      FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base RUN apt-get update RUN apt-get install -y libc6 libicu-dev libfontconfig1 RUN cd /usr/lib && ln -s libgdiplus.so gdiplus.dll

      Had you used System.Drawing.Common 6.0 (or its dependencies like System.Security.Permissions), you would need to set "System.Drawing.EnableUnixSupport": true or take additional actions as per https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only#recommended-action.

      If you explicitly reference System.Drawing.Common 7.0, then PlatformNotSupportedException is expected, at least until we remove System.Drawing.Common 5.0 from DevExpress.ExpressApp and all its dependencies OR rather support System.Drawing.Common 7.0 with Image > DXImage and other replacements from DevExpress.Drawing. As you may understand, this is a large undertaking and we have not planned this so far. This will be a huge breaking change for thousands of DevExpress customers, because Image, Font, and other System.Drawing.Common API are widely used (for instance, in ImageLoader, Conditional Appearance, etc.).

      Having said that, we will likely keep the current System.Drawing.Common 5.0 dependency in our libraries until Microsoft ships security patches for it (https://dotnet.microsoft.com/en-us/platform/support/policy) and may consider to switch to System.Drawing.Common 6.0. By the time Microsoft ends support for this package version (for instance, after November 2024), we hope that we will be able to figure out how to minimize breaking changes for customers, remove .NET Standard support from current libraries, and switch to what Microsoft recommends at that time. I hope this makes sense.

      M M
      Martin Praxmarer - DevExpress MVP 2 years ago

        Thx Dennis for the detailed answer - my initial understanding was that support for net7 - means also System.Drawing.Common 7.0 ;) so for now we can easy go with 5.0 or 6.0 - thank you!

        Answers approved by DevExpress Support

        created a year ago

        Great news! In v23.2, we eliminated use of System.Drawing.Common API references across XAF Blazor/WinForms UI and Web API Service. This allowed our cross-platform libraries to work as expected across Linux, Mac, Windows, Android, iOS for .NET 7, .NET 8 and future target frameworks. This change also simplified future development and deployment for new UI platforms, such as .NET MAUI and Blazor WebAssembly with .NET 8, 9, 10, etc. - Breaking Change.

        If you own an active Universal Subscription, feel free to download our Early Access Preview (EAP) build v23.2.1 for early testing (learn more). We look forward to hearing from you.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.