Unable to Use Aspose.Slides for .NET in Linux Based on Docker Container

Hello,

we are currently experiencing multiple issues running Aspose.Slides. Main issue is the exception System.PlatformNotSupportedException\nSystem.Drawing.Common is not supported on this platform in current nuget versions if run in linux docker container.

After some research I found you offer a ZIP release which is supposed to contain a crossplatform version of Aspose.Slides. However I cannot manage to successfully build our projects if I reference the different libraries version.

Additionally we have some type of different scenario. We are having several projects which run our code. We have
a) a desktop application requiring .Net 4.8
b) a microservice architecture for backends running in docker containers

As we do not want to duplicate our codes and projects we have a library to wrap aspose functionality into own classes which implement our required codes. This wrapper projects targets net48 and netstandard2.0.
The net48 build is used in the windows desktop application and the netstandard2.0 build is used in the microservices.
This has worked without issues with the Nuget releases.

Due to the upper mentioned changes I tried targeting the Aspose.Slides DLLs from your zip release. I noticed, in Visual Studio, you can add references individually for the different target platforms:
2023-08-09_16-46-06.png (5.5 KB)
However, if I add the net48 DLL to the net48 assemblys node and then add the netstandard2.0 dll to the netstandard2.0 assemblies node, I end up with both versions targeting the same version in the end. I don´t know if that´s a bug in Visual Studio that manually referencing a dll in a single target platform overrides the other target platforms or if it´s not possible to define different DLL for different target platform. That is our first issue already.

As I needed to get back up the microservices asap I decided to not care for the net48 build for the moment and forced it to reference the netstandard2.0 dll, as we target netstandard2.0 with our wrapper. But there is no crossplatform release in your zip for netstandard2.0 and the docker image won´t build in this setup neither. If I click the dockerfile of the microservice project to build the image. I managed to track this issue down to calling slide.GetThumbnail which returns a Bitmap.
See example_1 in my zip attachment.

As the crossplatform version of Aspose.Slides is included in the zip net6 folder I tried to reference that release instead (example_2). However, this also does not build with more errors. It now fails to recognize the Presentation constructor with a stream and LoadOptions and having further issues with ambigious name ImageFormat:
image.png (28.9 KB)

image.png (12.7 KB)

Examples:
aspose.zip (1.5 MB)
I tried to get rid of the not necessary codes and other project references to symbol the scenario we are in.

Additionally, we are required to create a software bills of materials for our desktop application. This is done as a step in the build server using the recommended tool GitHub - CycloneDX/cyclonedx-dotnet: Creates CycloneDX Software Bill of Materials (SBOM) from .NET Projects. Without a working and correct refrenced nuget package it´s not possible to create a complete SBOM as the nuget package seems to be required to include Aspose.Slides in the output SBOM. At least after I tried to replace the nuget reference with the zip release DLL files, Aspose.Slides was removed from the SBOM output:
image.png (54.1 KB)

In case you need an example to use cyclone-dx, this is our build batch script:

@echo off
@REM Restoring Packages
dotnet restore PROJECT.csproj

@REM Building
set TARGET_FRAMEWORK=net48
set CONFIGURATION=Release
set PLATFORM=AnyCPU
set OUTPUT_DIR=..\..
dotnet build Folder\PROJECT.csproj --configuration %CONFIGURATION% --framework %TARGET_FRAMEWORK% --runtime %PLATFORM%

@REM Publish to src
dotnet publish Folder\PROJECT.csproj --configuration %CONFIGURATION% --framework %TARGET_FRAMEWORK% --runtime %PLATFORM%

@REM Copy necessary files to parent directory
xcopy /s /y /i Folder\bin\%CONFIGURATION%\%TARGET_FRAMEWORK%\%PLATFORM%\publish\* ..\..

@REM Creating BOM
@REM https://github.com/CycloneDX/cyclonedx-dotnet/issues/725 -> Bis ein Update da ist Version 2.7 benutzen!
call dotnet tool update --global CycloneDX --version 2.7.*
call dotnet CycloneDX "Folder\PROJECT.csproj" -o "..\..\..\bom\aspose" -j -d -t -tfm "net48"
copy "..\..\..\bom\aspose\bom.json" "..\..\..\bom\components\aspose.json"

@Serraniel,
Thank you for describing the issue. I am working on the issue and will get back to you as soon as possible.

@Serraniel,
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): SLIDESNET-44137

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.

@Serraniel,
Could you please share the dockerfile you used?

Here is a zip with our productive dockerfile and the productive csproj files for the microservice project and the project which wrapps Aspose libraries. I hope that is helpful.

Config.zip (2.3 KB)

@Serraniel,
Thank you for the files. I’ve forwarded them to our developers.