We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

.NET 6 Support missing for Aspose.Cells, Aspose.Imaging, Aspose.PDF, Aspose.Slides.NET on macOS, Linux

System.Drawing was deprecated on .NET 6 and there does not seem to be a replacement ready from Aspose for macOS and Linux.

I have attached a test project which fails completely on macOS, and partially on Linux.

On macOS libgdiplus is used internally and cannot be found.

We are currently using .NET 5 in our production code and cannot upgrade to .NET 6 only because of Aspose. We are paying a lot for the Aspose.Total license and expect that this should be fixed a.s.a.p

AsposeTestApp.zip (756.2 KB)

Output on macOS:
Aspose.Cells failed with exception: System.TypeInitializationException: The type initializer for ‘’ threw an exception.

**---> System.TypeInitializationException: The type initializer for 'Gdip' threw an exception.**

**---> System.DllNotFoundException: Unable to load shared library 'libgdiplus' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(liblibgdiplus, 1): image not found**

**at System.Drawing.SafeNativeMethods.Gdip.GdiplusStartup(IntPtr& token, StartupInput& input, StartupOutput& output)**

**at System.Drawing.SafeNativeMethods.Gdip..cctor()**

**--- End of inner exception stack trace ---**

**at System.Drawing.SafeNativeMethods.Gdip.GdipStringFormatGetGenericTypographic(IntPtr& format)**

**at System.Drawing.StringFormat.get_GenericTypographic()**

**at ..cctor()**

**--- End of inner exception stack trace ---**

**at Aspose.Cells.Workbook.Save(String fileName, SaveOptions saveOptions)**

**at Aspose.Cells.Workbook.Save(String fileName, SaveFormat saveFormat)**

**at TestApp.TestAsposeCells() in /Users/mk/Documents/repos/projects/atlas-ti/AsposeTestApplication/AsposeTestApp/Program.cs:line 27**

**❌ Aspose.Cells test failed.**

**Aspose.Drawing failed with exception: Aspose.Imaging.CoreExceptions.ImageLoadException: Image loading failed.**

**---> System.TypeInitializationException: The type initializer for 'Gdip' threw an exception.**

**---> System.DllNotFoundException: Unable to load shared library 'libgdiplus' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(liblibgdiplus, 1): image not found**

**at System.Drawing.SafeNativeMethods.Gdip.GdiplusStartup(IntPtr& token, StartupInput& input, StartupOutput& output)**

**at System.Drawing.SafeNativeMethods.Gdip..cctor()**

**--- End of inner exception stack trace ---**

**at System.Drawing.SafeNativeMethods.Gdip.GdipGetGenericFontFamilySansSerif(IntPtr& fontfamily)**

**at System.Drawing.FontFamily.GetGdipGenericSansSerif()**

**at System.Drawing.FontFamily.get_GenericSansSerif()**

**at System.Drawing.Font.CreateFont(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte charSet, Boolean isVertical)**

**at System.Drawing.Font..ctor(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)**

**at System.Drawing.Font..ctor(String familyName, Single emSize, String systemName)**

**at System.Drawing.SystemFonts.get_DefaultFont()**

**at Aspose.Imaging.ImageOptionsBase..ctor()**

**at Aspose.Imaging.ImageOptions.JpegOptions..ctor()**

**at Aspose.Imaging.FileFormats.Jpeg.JpegImage.(IRasterImageArgb32PixelLoader , Int32 , Int32 )**

**at Aspose.Imaging.FileFormats.Jpeg.JpegImage..ctor(Int32 , Int32 , PixelFormat , IRasterImageArgb32PixelLoader)**

**at Aspose.Imaging.FileFormats.Jpeg.JpegImage.(Int32 , Int32 , PixelFormat , IRasterImageArgb32PixelLoader)**

**at ​  .(StreamContainer , LoadOptions ,     )**

**at ​  .Load(StreamContainer , LoadOptions )**

**at Aspose.Imaging.Image.(StreamContainer , LoadOptions )**

**--- End of inner exception stack trace ---**

**at Aspose.Imaging.Image.(StreamContainer , LoadOptions )**

**at Aspose.Imaging.Image.Load(String filePath)**

**at TestApp.TestAsposeImaging() in /Users/mk/Documents/repos/projects/atlas-ti/AsposeTestApplication/AsposeTestApp/Program.cs:line 67**

**❌ Aspose.Imaging test failed.**

**Aspose.PDF or Aspose.Slides failed with exception: System.TypeInitializationException: The type initializer for 'Gdip' threw an exception.**

**---> System.DllNotFoundException: Unable to load shared library 'libgdiplus' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(liblibgdiplus, 1): image not found**

**at System.Drawing.SafeNativeMethods.Gdip.GdiplusStartup(IntPtr& token, StartupInput& input, StartupOutput& output)**

**at System.Drawing.SafeNativeMethods.Gdip..cctor()**

**--- End of inner exception stack trace ---**

**at System.Drawing.SafeNativeMethods.Gdip.GdipCreateRegion(IntPtr& region)**

**at System.Drawing.Region..ctor()**

**at #=zvOvOCvAZdP9GKJbmjgz$R3n0SyW1lQkIDg==.#=zFXNUONI=(#=zgNo5e0c9gHO8iAzPeGDDCCmDofqueD3xBg== #=zipu5u0o=)**

**at #=zBfVGVJP1ImTF2VMm51lpZn3sdXAWZEBsAZEeCIg=.Clone()**

**at #=znY0mL9L8ZXHn6zoXHjR4epGJ2nT$IeqDq9igD88=.#=z$x796Lk=()**

**at #=zX3wLNV33MSef95lWrnGG8PD3VGNkDOq1RvkslOI=.#=z$x796Lk=()**

**at #=zFLKHFi4q9yQT1s7qN9F3Pjy$o8eM.#=zN6Su7Bt4x59b()**

**at #=zO_v9jFVLPvhndS6E25XjW2_VhVcTYwj$hhd2W8bIPtlf.#=zN6Su7Bt4x59b()**

**at #=zO_v9jFVLPvhndS6E25XjW2_VhVcTYwj$hhd2W8bIPtlf.#=zU$FPplMDcrxH()**

**at #=zO_v9jFVLPvhndS6E25XjW2_VhVcTYwj$hhd2W8bIPtlf.#=zyxshG1k=()**

**at #=z0aJDmtQnP84snmHpgfuK6128xiUdtBMsm81XOxDKPYWF.#=zueCMkwI=(#=zKis5YHRVAFmKO3SRk38yhTIyu03K #=zsO4AC6o=, #=zq4EcwWUNU5$UAcJIvUU02vVp$_UGREkusA== #=zBI5F_R8=, #=zNk3AsTPFQ2EkegyDfWuwqwSXIpIdz6AxXxvgTT55MKFI #=zncHgIAs=)**

**at Aspose.Pdf.Page.CalculateContentBBox()**

**at Aspose.Pdf.Page.#=z4GzPgR4=(Page #=zBI5F_R8=)**

**at Aspose.Pdf.Document.ProcessParagraphs()**

**at Aspose.Pdf.Document.#=zHSU7TJ1r2p51(Stream #=zrzqVF2Y=, SaveOptions #=zZd9LooIUKdl_)**

**at Aspose.Pdf.Document.#=zB20ZmbtNdN0B(String #=zzO$7SyTN6dm8)**

**at Aspose.Pdf.Document.Save(String outputFileName)**

**at TestApp.TestAsposePDFAndSlides() in /Users/mk/Documents/repos/projects/atlas-ti/AsposeTestApplication/AsposeTestApp/Program.cs:line 122**

**❌ Aspose.PDF test failed.**

Output on Linux (Ubuntu 20.04 LTS):
:white_check_mark: Aspose.Cells passed
:white_check_mark: Aspose.Imaging passed.
Aspose.PDF or Aspose.Slides failed with exception: System.ArgumentNullException: Value cannot be null. (Parameter ‘key’)
at System.Collections.Generic.Dictionary2.FindValue(TKey key) at System.Collections.Generic.Dictionary2.TryGetValue(TKey key, TValue& value)
at #=zImCMOVW4Q3GzTpxMJPnysqY_Hem_y9_Ssw==.#=zP2De2SY=(#=zHIIHG70= #=zSMrJg1s=)
at #=zCeoPH_KffNVGf_181UtpTifkgttwVyxTfg==.#=zVOvOV2BhWode.#=z_0dLgp58IWeE(#=zHIIHG70= #=zSMrJg1s=, #=zGcJUKFM=& #=zIGoo4fI=)
at #=zy_TdDmgrkspggfsImFtYtlPt2sKkiUouJD7fAKo=.#=zjM9iwv46Yvm8(#=zFmA20cmyVm5QZ$0jFMrqaP3Ohjh1 #=zApgLdk7MrIle)
at #=zO_v9jFVLPvhndS6E25XjW2_VhVcTYwj$hhd2W8bIPtlf.#=zU$FPplMDcrxH()
at #=zO_v9jFVLPvhndS6E25XjW2_VhVcTYwj$hhd2W8bIPtlf.#=zyxshG1k=()
at #=z0aJDmtQnP84snmHpgfuK6128xiUdtBMsm81XOxDKPYWF.#=zueCMkwI=(#=zKis5YHRVAFmKO3SRk38yhTIyu03K #=zsO4AC6o=, #=zq4EcwWUNU5$UAcJIvUU02vVp$UGREkusA== #=zBI5F_R8=, #=zNk3AsTPFQ2EkegyDfWuwqwSXIpIdz6AxXxvgTT55MKFI #=zncHgIAs=)
at Aspose.Pdf.Page.CalculateContentBBox()
at Aspose.Pdf.Page.#=z4GzPgR4=(Page #=zBI5F_R8=)
at Aspose.Pdf.Document.ProcessParagraphs()
at Aspose.Pdf.Document.#=zHSU7TJ1r2p51(Stream #=zrzqVF2Y=, SaveOptions #=zZd9LooIUKdl
)
at Aspose.Pdf.Document.#=zB20ZmbtNdN0B(String #=zzO$7SyTN6dm8)
at Aspose.Pdf.Document.Save(String outputFileName)
at TestApp.TestAsposePDFAndSlides() in /home/devops/Dokumente/AsposeTestApplication/AsposeTestApp/Program.cs:line 122
:x: Aspose.PDF test failed.

@ATLAS.ti_dev

A ticket as PDFNET-50918 has already been logged in our issue tracking system to test the functionality of Aspose.PDF under .NET 6.0 in non-Windows environment e.g. Linux, macOS. The ticket has been linked to this thread as well so that you will be notified as soon as it is resolved. Please spare us some time.

We apologize for the inconvenience.

PS: We will be sharing feedback for other Aspose APIs soon with you.

As far as I can see PDFNET-50918 was first mentioned in November 2021. I hope this will be fixed soon and you can give me an estimate when this will be.

@ATLAS.ti_dev,
As for Aspose.Slides, I’ve linked this forum thread to an appropriate task with ID SLIDESNET-42778 in our issue tracking system. You will be notified when Aspose.Slides supports .NET 6. This is planned for Aspose.Slides 22.7. This release will be published in the second half of July.

@ATLAS.ti_dev.

Regarding your issue for Aspose.Cells, we have logged a ticket with an id “CELLSNETCORE-389” for your issue. We are already looking into it. We think we have to get rid of Libgdiplus to solve such problems. We decide to use Aspose.Drawing for Aspose.Cells to test and evaluate issues on Linux or non-Windows platforms. Our plan is to implement in sync when the official version of .NET 7 (expected by the end of 2022) is released by Microsoft.

@ATLAS.ti_dev

Please note that this ticket is currently one of top prioritized tasks for us. We plan to complete the investigation in the 3rd quarter of this year. We will let you know once we have further updates.

This is really a problem for us: one key component of our app is to export Excel files. If we have to wait that long we have to look into other products to get that functionality instead. I really don’t understand why you need to rely on libgdiplus to export a simple Excel file.

@ATLAS.ti_dev,

We will evaluate your issue in details (we already logged a ticket “CELLSNETCORE-389” for the issue) and get back to you soon.

We are sorry for any inconvenience caused!

Hi @ATLAS.ti_dev
Before Net 7 official release we still have some time for Migration of Graphics Library,
let me first solve for you the issues of Aspose.Cells that encountered in net 6 in macOS.
First, I set up the environment:
Monterey 12.4.
visual studio 2022 for MAC,
.Net60

In the above initial environment, running the program you provided does reproduce the problem.
Then please install libgdiplus in macOS to solve it:
brew install mono-libgdiplus

Read more:

I tested this solution, and it can take effect in. Net 6 environment in Monterey, pptx file can be generated.

Hi,
I know that I can install mono-libgdiplus however I cannot ask our customers to install Homebrew and mono-libgdiplus so we would have to package the dynamic libraries with our app. However it looks like the libgdiplus-dylibs are tied to the macOS-version, so we would have to extract and bundle it for macOS 10.13, 10.14, 10.15, 11.0 and 12.0 Intel and macOS 11.0 and 12.0 for Apple Silicon and decide in the app which version to use with DYLIB_LIBRARY_PATH, which does not look like a good solution.

@ATLAS.ti_dev,

Thanks for your feedback.

We will evaluate it further and get back to you.

@ATLAS.ti_dev,

You can’t use System.Drawing.Common APIs without installing libgdiplus on Linux or macOS in .NET6. We are sorry but from your point of view, it can only be resolved after the migration process of the Graphics Library is completed.