PlatformNotSupportedException loading .one file on linux platform

simply calling the following code:

var doc = new Document("test.one");

produces the following exception on ubuntu linux.
I have followed the recommendation in this post and installed mono, libgdi and libc6 but the exception still occurs.
For your reference, here are the commands I am running in the container prior to trying the code:

                      # install fontconfig
                      - apt-get update; apt-get install -y fontconfig
                      # install mono
                      - apt install -y ca-certificates gnupg
                      - gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
                      - echo "deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/ubuntu stable-focal main" | tee /etc/apt/sources.list.d/mono-official-stable.list
                      - apt update
                      - apt install -y mono-complete
                      # install libgdiplus & libc6
                      - apt-get install -y libgdiplus
                      - pushd /usr/lib && ln -s libgdiplus.so gdiplus.dll && popd
                      - apt-get install -y --no-install-recommends libc6-dev

and here is the exception:

System.PlatformNotSupportedException: System.Drawing.Common is not supported on this platform.
   at System.Drawing.SystemFonts.get_DefaultFont()
   at .()
   at .()
   at .( ,  , e& )
   at .()
   at .()
   at .( ,  ,  )
   at .( , & ,  , [] )
   at .(Queue`1 ,  , UInt32 , [] )
   at .()
   at .()
   at .( ,  ,  )
   at .( , & ,  , [] )
   at .(Queue`1 ,  , UInt32 , [] )
   at .()
   at .()
   at .( ,  ,  )
   at .( , & ,  , [] )
   at .(Queue`1 ,  , UInt32 , [] )
   at .()
   at .()
   at .( ,  ,  )
   at .[T](IEnumerable`1 , T& ,  )
   at .[T]( , T& ,  )
   at .( )
   at .(e ,  )
   at .()
   at .( , Boolean )
   at .(Stream , String , Boolean )
   at .(Stream , Document , LoadOptions )
   at Aspose.Note.Document.(Stream , LoadOptions )
   at Aspose.Note.Document.(String , LoadOptions )
   at Aspose.Note.Document..ctor(String filePath, LoadOptions loadOptions)
   at Aspose.Note.Document..ctor(String filePath)

@Buffer2018,

Apparently, the issue is related to missing System.Drawing library on .NET6 for non-Windows platforms. Aspose.Note uses System.Drawing APIs for parsing/rendering shapes/drawing objects from OneNote files. As per Microsoft, On non-Windows operating systems, unless you set a runtime configuration switch, a TypeInitializationException exception is thrown with PlatformNotSupportedException as the inner exception. You may try the workaround, if it fixes the issue?

We will use Aspose.Drawing APIs to sort out the issue. So far, we have tested latest Aspose.Drawing API. We found and reported a few bugs to concerned team. All of them are not resolved yet. But the situation looks very promising. For now, we think we will switch to Aspose.Drawing during this year if the posted issues are fixed precisely.

I am sorry to report that the fix does not work and I am still getting the same exception.
My runtimeconfig.json file:

{
  "runtimeOptions": {
    "tfm": "net8.0",
    "framework": {
      "name": "Microsoft.NETCore.App",
      "version": "8.0.0"
    },
    "configProperties": {
      "System.Drawing.EnableUnixSupport": true,
      "System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
      "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
    }
  }
}

the exception:

2024-01-15 15:25:58.826 +00:00 [ERR] caught exception
System.PlatformNotSupportedException: System.Drawing.Common is not supported on this platform.
   at System.Drawing.SystemFonts.get_DefaultFont()
   at .()
   at .()
   at .( ,  , e& )
   at .()
   at .()
   at .( ,  ,  )
   at .( , & ,  , [] )
   at .(Queue`1 ,  , UInt32 , [] )
   at .()
   at .()
   at .( ,  ,  )
   at .( , & ,  , [] )
   at .(Queue`1 ,  , UInt32 , [] )
   at .()
   at .()
   at .( ,  ,  )
   at .( , & ,  , [] )
   at .(Queue`1 ,  , UInt32 , [] )
   at .()
   at .()
   at .( ,  ,  )
   at .[T](IEnumerable`1 , T& ,  )
   at .[T]( , T& ,  )
   at .( )
   at .(e ,  )
   at .()
   at .( , Boolean )
   at .(Stream , String , Boolean )
   at .(Stream , Document , LoadOptions )
   at Aspose.Note.Document.(Stream , LoadOptions )
   at Aspose.Note.Document.(String , LoadOptions )
   at Aspose.Note.Document..ctor(String filePath, LoadOptions loadOptions)
   at Aspose.Note.Document..ctor(String filePath)
   at SafeBridge.Providers.BufferzoneCDR.OneNoteCDR.IsPasswordProtected()

@Buffer2018,

Thanks for your feedback and further details.

As we told you the issue is related to missing System.Drawing library on advanced .NET versions for non-Windows platforms. Anyways, we will evaluate and investigate your issue in details. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): NOTENET-5824

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@Buffer2018,

We used our docker file (attached) and found no issue, the library was launched without any errors. We will try to build one for your needs but it might take sometime. In the meantime, could you please refer to the docker file (attached) and try to figure out your issue and it works on your end?
Dockerfile.zip (816 Bytes)

according to Breaking change: System.Drawing.Common config switch removed - .NET | Microsoft Learn the workaround using System.Drawing.EnableUnixSupport: true has stopped working from .net 7 on.
So as per my understanding “aspose.note” does not deserve the label “platform independence” anymore (as stated on the product page).

@lotzer,

We apologize for the inconvenience. Our plan is to use Aspose.Drawing to address such issues without resorting to using the switch or workaround on non-Windows platforms. Currently, we are in the process of integrating Aspose.Drawing into our API. Some issues are still unresolved, so we cannot upgrade to Aspose.Drawing until all the issues are precisely fixed. Once we have an update on this, we will notify you here.

@lotzer,

Moreover, this breaking change now applies to .NET 7 but not to others or previous versions. Our library can still be used under .NET Core, and for targeting frameworks such as .NET 6 and .NET 7, Aspose.Drawing will be used instead of System.Drawing after we have fully supported/integrated it into Aspose.Note.

for .Net 6 it is possible, but not for .Net 7 and .Net 8 (unless running only on windows).

@lotzer,

Yes, currently, you may say that. For .NET 7/8, it will be possible once Aspose.Drawing is integrated to Aspose.Note API.

Any progress on this? Any plan when this fix (replacing System.Drawing with Aspose.Drawing) will be available?
Thx

@lotzer,

We have plans, but it will still take time to complete the migration from System.Drawing to Aspose.Drawing. Anyways, we will still check if we could give you a rough estimate for it. We may get back to you soon.

Any progress/ETA?

@rafaeloliveira,

Apologies, but we currently do not have an estimated time for it. We will inform you here once we have any new updates. We apologize for any inconvenience this may cause to you.

@rafaeloliveira,

For your information, the implementation and integration of Aspose.Drawing is a complex task on its own, which requires more time and resources. We also offer priority support model to post tickets on the helpdesk. Therefore, you may consider purchasing and using the priority support model to raise/prioritize your desired issues.