I’m using Aspose. Words 18.8.0 for creating pdf from doc templates. My app is written in C# and runs on. Net Core 2.1.
Everything works fine on my development PC with Windows 7 under Administrator account. Problem occurs after deployment on server.
Failing process is hosted by IIS 8 on Windows server 2012. I read your info at this page
about necessity to use Full Trust permissions, but this mechanic no longer exists in.net core. How should I set my server environment to make it work?
Thank you very much.
System.TypeInitializationException: The type initializer for ‘SkiaSharp.SKImageInfo’ threw an exception. —> System.DllNotFoundException: Unable to load DLL ‘libSkiaSharp’ or one of its dependencies: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
at SkiaSharp.SKImageInfo…cctor()
— End of inner exception stack trace —
at Aspose.Words.Document.( , SaveOptions )
at Aspose.Words.Document.(Stream , String , SaveOptions )
at Aspose.Words.Document.Save(Stream stream, SaveOptions saveOptions)
Thanks for your inquiry. You are facing this issue because your application does not find the DLL libSkiaSharp where you are hosting it. Could you please share the steps that you are using to create and host your application at Windows Server 2012? Please also share your input Word document. We will investigate the issue on our side and provide you more information.
Thanks for your reply. Problem occurs on any Word doc containing image during rendering to Pdf (Save with PdfSaveOptions {Compliance = PdfCompliance. PdfA1b}). I can see that loading libSkiaSharp (or dependencies) is the problem, it is written in my exception, but “Access is denied” suggests that there is a problem with access rights which cause inability to load dll. And because of the note about Full Trust permissions in your documentation (link above), I expect that I need some special permissions. So my question is: How should I set user security on my configuration? Which permissions my service user needs? Which resources libSkiaSharp needs to access? Thank you
No, I’m installing Aspose.Words thru Nuget into VS solution on my development PC with Win7
Yes
Can you specify what exactly do you need? I wrote down info about system on which I’m deploying in my original question. Furthermore it is classic, VS studio 2017 => git => TFS build and deploy => Win Server 2012. It can be described in many levels of details, can you specify what details are important for you? I would expect questions like: “What is build version of your build agent?” etc.
Most important for me are these questions, could you please answer? 1) What permissions do IIS service user needs on my configuration? 2) What resources do Aspose needs to access?
Thank you
Hello, I have new finding. Aspose.Words Pdf rendering works fine with IIS app pool running under user with Administrator privileges. And it does not work with common user with minimal privileges. This is not solution because it can not be used on production environment. So I’m back to my question. Which resources/folders is Aspose using? What minimal privileges needs to be set to let it work? Thank you
Thanks for your inquiry. We have logged this problem in our issue tracking system as WORDSNET-17385. You will be notified via this forum thread once this issue is resolved.
The type initializer for ‘SkiaSharp.SKImageInfo’ threw an exception.
Unable to load DLL ‘libSkiaSharp’ or one of its dependencies
I also want to note that I did the suggested uninstall, remove bin folder, and reinstall from NuGet suggested in other post, that did not fix the issue.
Thank You for your post. But this does not fix “Access is denied” issue from this thread.
I’m already deploying libSkiaSharp.dll to my web server, so libSkiaSharp.dll is loaded, but some of its dependencies can not be accessed without Administrator account.
I don’t think it is a dependency, it works for me now and there are no other dependencies I needed other than the missing dll. Checking the SkiaSharp project on Git only shows things for Windows 10.
Sorry it did not work, I was trying to post in one place, and a more recent place, instead of all the others post related to issues of not having libSkiaSharp.dll in the web folder. Such as missing images in PDFs, and the error of not finding libSkiaSharp library.
The only thing I can offer as suggestion would be checking security for the folder and/or the libSkiaSharp.dll file setup for both IUSR and IIS_IUSRS? I have a vague recollection of working on some versions of IIS that would need both the user and the group setup for security. Going out on a limb is the file blocked? For my setup I did not need any addition security settings, but I have windows 2016 not 2012. Another option, but I know installing software on servers is not an option sometimes, install Process Monitor to see exactly what and who is getting denied access.