When run this program using net6.0 in Linux platform(ubuntu), following error is thrown.
Unhandled exception. System.PlatformNotSupportedException: System.Drawing.Common is not supported on this platform.
at System.Drawing.FontFamily.get_GenericSerif()
:
:
at Aspose.Slides.MasterSlideCollection.(MasterSlide , Boolean )
at Aspose.Slides.MasterSlideCollection.(IMasterSlide , Boolean )
at Aspose.Slides.SlideCollection.AddClone(ISlide sourceSlide)
at Aspose.Slides.SlideCollection.InsertClone(Int32 index, ISlide sourceSlide)
I know that System.Drawing.Common is not supported on Linux platform in Net 6.0.
Also, tried to set “System.Drawing.EnableUnixSupport”: true. But the error still occurs.
@shanaki,
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-44103
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.
Release note mention that Aspose.Slides.dll for crossplatform is available for ZIP and MSI releases. Does this dll resolve the above exception error on Linux?
If so, please let me know how to use it because I could not find instruction to use Aspose.Slides.dll for crossplatform.
.NET 6: Nuget depends on System.Drawing.Common, a cross-platform version is available in the ZIP and MSI releases
Aspose.Slides assembly for .NET 6 will now be presented as:
Nuget package: dependency on System.Drawing.Common, Windows only.
@shanaki, @eirik.rude,
We are awaiting the guidance from our development team and will provide it to you as soon as it is ready. Thank you for your patience.
Copy all files under crossplatform into bin/Debug/net6.0
Then, execute “dotnet run --no-build” (Because, dotnet run rebuilds and overwrites copied Aspose.Slides.dll with original Aspose.Slides.dll.)
Following error occurs.
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, Nullable`1 searchPath, Boolean throwOnError)
at System.Runtime.InteropServices.NativeLibrary.Load(String libraryName, Assembly assembly, Nullable`1 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 .(Size , )
at .(Size )
at Aspose.Slides.Slide.GetThumbnail(Size imageSize)
at Presentation )
at resentation , Stream , , IPptxOptions, InterruptionToken )
at Aspose.Slides.Presentation.(Stream , , IPptxOptions )
at Aspose.Slides.Presentation.Save(Stream stream, SaveFormat format, ISaveOptions options)
at Aspose.Slides.Presentation.Save(String fname, SaveFormat format)
Please let me know more detail how to do following things.
1. Aspose.Slides.zip\Aspose.Slides\net6.0\crossplatform\ contains DLLs that should be referenced in your project.
2. Other DLLs and dylib files should be placed in the build output directory since Aspose.Slides.dll depends on them.
Aspose.Slides.dll is a .NET assembly. It should be referenced in the project.
aspose.slides.drawing.capi_vc14x64.dll, aspose.slides.drawing.capi_vc14x86.dll, libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so are C++ libraries, each for the corresponding target platform (these libraries should be included in the project and set to copy to the output directory because Aspose.Slides.dll will load the required lib on the startup).
At first, I created a new project.
% dotnet new console -o “linuxeval2”.
Then, add Aspose.Slides.NET 23.6.0 package.
% dotnet add package Aspose.Slides.NET --version 23.6.0
As to step4, you mentioned that “set to copy to the output directory”. What is “output” directory? In my case, where should I copy aspose.slides.drawing.capi_vc14x64.dll, aspose.slides.drawing.capi_vc14x86.dll, libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so?