Aspose.Imaging calls working in dotnet 6, not in dotnet8

I have C# code using aspose.imaging version 23.5 running in a linux container that works in asp.net 6, but not asp.net 8.

It does work on my Windows Desktop with dotnet 8.
It reports it’s unable to find libkernel32.dll.so or libkernel32.dll in a number of different paths.

Are there known fixes for this issue?
The error is:

Unhandled Exception: Aspose.Imaging.CoreExceptions.ImageLoadException: Image loading failed.
—> Aspose.Imaging.CoreExceptions.ImageLoadException: Unable to read file.
Exception: Unable to load shared library ‘kernel32.dll’ or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you’re using glibc, consider setting the LD_DEBUG environment variable:
/app/runtimes/linux-x64/native/kernel32.dll.so: cannot open shared object file: No such file or directory
/usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.10/kernel32.dll.so: cannot open shared object file: No such file or directory
/app/kernel32.dll.so: cannot open shared object file: No such file or directory
/app/runtimes/linux-x64/native/libkernel32.dll.so: cannot open shared object file: No such file or directory
/usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.10/libkernel32.dll.so: cannot open shared object file: No such file or directory
/app/libkernel32.dll.so: cannot open shared object file: No such file or directory
/app/runtimes/linux-x64/native/kernel32.dll: cannot open shared object file: No such file or directory
/usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.10/kernel32.dll: cannot open shared object file: No such file or directory
/app/kernel32.dll: cannot open shared object file: No such file or directory
/app/runtimes/linux-x64/native/libkernel32.dll: cannot open shared object file: No such file or directory
/usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.10/libkernel32.dll: cannot open shared object file: No such file or directory
/app/libkernel32.dll: cannot open shared object file: No such file or directory

@mcrose

It seems that you are encountering an issue with the Aspose.Imaging library when running your application in a Linux container with .NET 8. The error message indicates that the library is unable to find kernel32.dll, which is a Windows-specific library and not available on Linux systems.

Here are some steps you can take to resolve this issue:

  1. Check Compatibility: Ensure that you are using a version of Aspose.Imaging that is compatible with .NET 8 and Linux. The library is designed to be cross-platform, but certain dependencies may vary between operating systems.

  2. Install Required Dependencies: For Aspose.Imaging to function correctly on Linux, you may need to install additional libraries. Specifically, you should install the libgdiplus package, which provides necessary graphics functionality. You can install it using the following command on Ubuntu:

    sudo apt-get install -y libgdiplus
    
  3. Use the Correct Runtime: Make sure that your application is targeting the correct runtime. If you are using .NET 8, ensure that all dependencies are also compatible with this version.

  4. Check for Updates: Ensure that you are using the latest version of Aspose.Imaging. Sometimes, issues are resolved in newer releases, so updating the library might help.

  5. Review Documentation: Consult the Aspose.Imaging documentation for any specific instructions related to running the library on Linux. There may be additional configuration steps or dependencies that you need to be aware of.

If you continue to experience issues after trying these steps, consider reaching out to the Aspose support team or checking the Aspose forums for similar issues reported by other users.

Sources:
[1]: Plugins Licensing - Installation - Aspose Documentation

Hello, @mcrose
In your case, you will most likely need to install libgdiplus or use Aspose.Imaging.Drawing, which does not depend on libgdiplus.

sudo apt-get install -y libgdiplus