I am trying to use cross platform version of the aspose library:
PackageReference Aspose.Slides.NET6.CrossPlatform 23.11.0
To create self-contained linux package
dotnet publish -r lin> ux-x64 -o …//linux-x64 -c Release --self-contained true -p:PublishSingleFile=true
Build process is outputing native linux library:
libaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so
But Running the self-contained library is failing with the next error:
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, Nullable
1 searchPath)
at .(String , Assembly, Nullable`1 )
at System.Runtime.InteropServices.NativeLibrary.LoadLibraryCallbackStub(String libraryName, Assembly assembly, Boolean hasDllImportSearchPathFlags, UInt32 dllImportSearchPathFlags)
at .d(Int32 d, Int32 v, Int32 c, IntPtr& t)
at System.Drawing.Bitmap…ctor(Int32 width, Int32 height, PixelFormat format)
at System.Drawing.Bitmap…ctor(Int32 width, Int32 height)
at …cctor()
— End of inner exception stack trace —
at …ctor(Presentation )
at tor(TextFrame )
at Aspose.Slides.TextFrame…ctor( )
at Aspose.Slides.AutoShape()
at .(IAutoShape , , )
atGroupShape, )
at GroupShape , )
at .(IBaseSlide , )
at .(IMasterSlide )
at .(IPresentation )
at .( , IPresentation)
at .(Presentation , Stream, InterruptionToken )
— End of inner exception stack trace —
at .(Presentation , Stream, InterruptionToken )
at Aspose.Slides.Presentation(Stream , Boolean)
at Aspose.Slides.Presentation.(Stream , Boolean)
at Aspose.Slides.Presentation.(String , Boolean)
NOTE: library is search the liblibaspose.slides.drawing.capi_x86_64_libstdcpp_libc2.23.so
→ liblibaspose instead of libaspose
Adding path the library path export LD_LIBRARY_PATH=/home/site/wwwroot/tools/linux-x64 is not solving the problem.
Linux version:
PRETTY_NAME=“Debian GNU/Linux 11 (bullseye)”
NAME=“Debian GNU/Linux”
VERSION_ID=“11”
VERSION=“11 (bullseye)”
VERSION_CODENAME=bullseye
ID=debian
Code
using (var presentation = new Aspose.Slides.Presentation(sourcePresentation))
{
// save the presentation to PDF
presentation.Save(outputFile, Aspose.Slides.Export.SaveFormat.Pdf);
}