The ImageFormat Type Exists in Both Aspose.Slides and System.Drawing.Common

Hi @andrey.potapov, We are facing similar issues when using Aspose.Slides 23.3.0 version.

In our .Net 6 project we are using the following Aspose products:

  • Aspose.PDF 23.2.0
  • Aspose.Cells 23.2.0
  • Apose.Imaging 23.2.0
  • Aspose.Words 23.2.0
  • Aspose.Slides.NET

If we are using the Aspose.Slides.NET 23.1.0 there is not problem but if we upgrade to 23.2.0 the following problem occures:

[CS0433] The type ‘ImageFormat’ exists in both ‘Aspose.Slides, Version=23.2.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ and ‘System.Drawing.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’

Here is a simple example project to reproduce the issue:
sampleProject.zip (1.6 KB)

@erdeiga,
Thank you for contacting support.

I am working on the issue you are experiencing and will get back to you as soon as possible.

@erdeiga,
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-43845

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.

1 Like

I’m having the same issue.

@nielsbosma,
Thank you for the message. Unfortunately, we don’t have any updates on the issue yet. We apologize for any inconvenience.

@erdeiga, @nielsbosma,
Our developers have investigated the case. You should use extern alias for Aspose.Slides.

More details:

1 Like

@andrey.potapov, I managed to solve the issue, thank you for your help.

Does Aspose.Slides dependencies changed? Because I tested it on a CentOS7 machine and the following error occurred:

Unable to load shared library ‘libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23’ or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23: cannot open shared object file: No such file or directory

I checked the .so with the ldd command and this was the result:

ldd ./bin/Unit/net6.0/libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so
./bin/Unit/net6.0/libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so: /lib64/libstdc++.so.6: version GLIBCXX_3.4.20' not found (required by ./bin/Unit/net6.0/libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so) ./bin/Unit/net6.0/libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so: /lib64/libstdc++.so.6: version GLIBCXX_3.4.21’ not found (required by ./bin/Unit/net6.0/libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so)
./bin/Unit/net6.0/libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.22’ not found (required by ./bin/Unit/net6.0/libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so)
linux-vdso.so.1 => (0x00007fffc274d000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f0f698e2000)
librt.so.1 => /lib64/librt.so.1 (0x00007f0f696da000)
libfontconfig.so.1 => /lib64/libfontconfig.so.1 (0x00007f0f69498000)
libfreetype.so.6 => /lib64/libfreetype.so.6 (0x00007f0f691d9000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f0f68fbd000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f0f68cb5000)
libm.so.6 => /lib64/libm.so.6 (0x00007f0f689b3000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f0f6879d000)
libc.so.6 => /lib64/libc.so.6 (0x00007f0f683cf000)
/lib64/ld-linux-x86-64.so.2 (0x00007f0f6dbb0000)
libexpat.so.1 => /lib64/libexpat.so.1 (0x00007f0f681a4000)
libuuid.so.1 => /lib64/libuuid.so.1 (0x00007f0f67f9f000)
libz.so.1 => /lib64/libz.so.1 (0x00007f0f6dda8000)
libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f0f67d8f000)
libpng15.so.15 => /lib64/libpng15.so.15 (0x00007f0f67b64000)

@erdeiga,
I am working on the issue you described and will get back to you as soon as possible.

@erdeiga,
Have you tested on CentOS7 using the same sample project from the first post above?

@andrey.potapov no but I can reproduce the problem with that also.

New sample project: sampleProject.zip (1.7 KB)

I used the following docker image: Docker

Pull and start the container

docker pull centos:centos7
docker run --rm -ti -v /PATH/TO/THE/PROJECT/:/AsposeSlides centos:centos7

Install .Net 6 sdk and other dependencies in the container

yum update -y
rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
yum -y install dotnet-sdk-6.0 freetype fontconfig

Build and run project

cd AsposeSlides/
dotnet build
dotnet run --project TestNewAsposeLibs

Error message

Unhandled exception. System.DllNotFoundException: Unable to load shared library ‘libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23’ or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23: cannot open shared object file: No such file or directory
at System.Runtime.InteropServices.NativeLibrary.LoadByName(String libraryName, QCallAssembly callingAssembly, Boolean hasDllImportSearchPathFlag, UInt32 dllImportSearchPathFlag, Boolean throwOnError)
at System.Runtime.InteropServices.NativeLibrary.LoadLibraryByName(String libraryName, Assembly assembly, Nullable1 searchPath, Boolean throwOnError) at System.Runtime.InteropServices.NativeLibrary.Load(String libraryName, Assembly assembly, Nullable1 searchPath)
at �.(String , Assembly , Nullable`1 )
at System.Runtime.InteropServices.NativeLibrary.LoadLibraryCallbackStub(String libraryName, Assembly assembly, Boolean hasDllImportSearchPathFlags, UInt32 dllImportSearchPathFlags)
at �.a(Int32 a, Int32 b, Int32 c, IntPtr& d)
at System.Drawing.Bitmap…ctor(Int32 width, Int32 height, PixelFormat format)
at System.Drawing.Bitmap…ctor(Int32 width, Int32 height)
at Program.<$>g__CreateImage|0_0(Int32 widthInPixel, Int32 heightInPixel, Color fillColor) in /AsposeSlides/TestNewAsposeLibs/Program.cs:line 6
at Program.$(String[] args) in /AsposeSlides/TestNewAsposeLibs/Program.cs:line 15

Check libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23 dependecies

ldd /AsposeSlides/TestNewAsposeLibs/bin/Debug/net6.0/libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so

Result:

/AsposeSlides/TestNewAsposeLibs/bin/Debug/net6.0/libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so: /lib64/libstdc++.so.6: version GLIBCXX_3.4.20' not found (required by /AsposeSlides/TestNewAsposeLibs/bin/Debug/net6.0/libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so) /AsposeSlides/TestNewAsposeLibs/bin/Debug/net6.0/libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so: /lib64/libstdc++.so.6: version GLIBCXX_3.4.21’ not found (required by /AsposeSlides/TestNewAsposeLibs/bin/Debug/net6.0/libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so)
/AsposeSlides/TestNewAsposeLibs/bin/Debug/net6.0/libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.22’ not found (required by /AsposeSlides/TestNewAsposeLibs/bin/Debug/net6.0/libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so)
linux-vdso.so.1 => (0x00007fff407e8000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f0f1454e000)
librt.so.1 => /lib64/librt.so.1 (0x00007f0f14346000)
libfontconfig.so.1 => /lib64/libfontconfig.so.1 (0x00007f0f14104000)
libfreetype.so.6 => /lib64/libfreetype.so.6 (0x00007f0f13e45000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f0f13c29000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f0f13921000)
libm.so.6 => /lib64/libm.so.6 (0x00007f0f1361f000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f0f13409000)
libc.so.6 => /lib64/libc.so.6 (0x00007f0f1303b000)
/lib64/ld-linux-x86-64.so.2 (0x00007f0f1881c000)
libexpat.so.1 => /lib64/libexpat.so.1 (0x00007f0f12e10000)
libuuid.so.1 => /lib64/libuuid.so.1 (0x00007f0f12c0b000)
libz.so.1 => /lib64/libz.so.1 (0x00007f0f129f5000)
libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f0f127e5000)
libpng15.so.15 => /lib64/libpng15.so.15 (0x00007f0f125ba000)

@erdeiga,
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-43853

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.

1 Like

@erdeiga,
Our developers have investigated the case. The CentOS7 GLIBC version is 2.14, Aspose.Slides for .NET 6 requires Linux x86_x64 with GLIBC >= 2.23. Could you please use CentOS8 or later to test/run your app?

A post was split to a new topic: Aspose.Slides Classes Conflict with the System.Drawing Package

@andrey.potapov,
CentOS8 is not supported since December 31st, 2021 but yes it is working if the required glibc is installed.

CentOS7 is still suported by .Net 6, I check the Aspose.Slides System Requirements and Release notes but there is no any information about this change.

Does that mean from 23.2.0 Aspose Slides doesn’t support CentOS7? This is a really bad news because CentOS7 has maintenance Updates until 2024-06-30.

Could you clarify what should we expect for the future of Aspose Slide releases and CentOS7 support?

@erdeiga,
I forwarded your information and the question to our development team and will get back to you as I get a response.

1 Like

@erdeiga,
Actually, Aspose.Slides supports CentOS 7, but not for .NET 6. Is it possible for you to use netstandard2.0 version of Aspose.Slides that is also included in our NuGet package?

1 Like