1
Unable to load DLL ‘PortableEngine.Native.dll’: The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)
Problem reported by Inbavalli Subramanian - 5/9/2022 at 6:59 PM
Resolved
Hi Gleamtech Support,

Some of our clients have been reporting this issue Unable to load DLL ‘PortableEngine.Native.dll’: The specified procedure could not be found. (Exception from HRESULT: 0x8007007F) after recent upgrade to our software. 

We haven't had this issue prior to our upgrade.


Can you please advise of the probable cause of it and also help us to resolve it?

3 Replies

Reply to Thread
0
Patrick Riehmers Replied
Dear Gleamtech Support, Dear Inbavalli,

i have nearly the same problem. The Stacktrace shows me the following error, from the call to /documentviewer.ashx/PrepareDocument 
{
  "Type": "GleamTech.DocumentUltimate.AspNet.UI.DocumentViewerException",
  "ImportantMessage": "Unable to load DLL 'PortableEngine.Native.dll' or one of its dependencies: A dynamic link library (DLL) initialization routine failed. (0x8007045A)",
  "Message": "The type initializer for '_bZE' threw an exception.",
  "StackTrace": "   at GleamTech.DocumentUltimate.AspNet.UI.DocumentViewerHandler.PrepareDocument(String cacheInfoKey, String attachment)\r\n   at lambda_method5158(Closure , Object , Object[] )\r\n   at GleamTech.Reflection.MethodInvoker.Invoke(Object instance, Object[] parameters)\r\n   at GleamTech.Reflection.MethodInvoker.GleamTech.Reflection.IMethodInvoker.Invoke(Object instance, Object[] parameters)\r\n   at GleamTech.AspNet.JsonMethodHandler.ExecuteMethod(MethodConfig methodConfig, Object[] parameterValues)\r\n   at GleamTech.AspNet.UI.ComponentHandler`1.ExecuteMethod(MethodConfig methodConfig, Object[] parameterValues)\r\n   at GleamTech.AspNet.JsonMethodHandler.Execute()",
  "InnerException": {
    "Type": "System.TypeInitializationException",
    "Message": "The type initializer for '_bZE' threw an exception.",
    "StackTrace": "   at lambda_method5067(Closure , Object[] )\r\n   at GleamTech.Reflection.ConstructorInvoker.Invoke(Object[] parameters)\r\n   at GleamTech.Reflection.ConstructorInvoker.GleamTech.Reflection.IConstructorInvoker.Invoke(Object[] parameters)\r\n   at _A9F._A6e(String engineName)\r\n   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)\r\n   at _A9F._ASf(String engineName)\r\n   at GleamTech.DocumentUltimate.DocumentConverter._Adg(DocumentFormatInfo inputFormatInfo, DocumentFormatInfo outputFormatInfo, String forcedEngineName)\r\n   at GleamTech.DocumentUltimate.DocumentConverter._bOF(DocumentFormatInfo inputFormatInfo, DocumentFormatInfo outputFormatInfo, Nullable`1 forcedEngine, DocumentEngine& foundKnownEngine)\r\n   at GleamTech.DocumentUltimate.DocumentConverter._byF(OutputContext outputContext, Nullable`1 engine)\r\n   at GleamTech.DocumentUltimate.DocumentConverter.ConvertTo(Stream outputStream, OutputOptions outputOptions, Nullable`1 engine)\r\n   at GleamTech.DocumentUltimate.Caching.DocumentCache._Azf._AaE(Stream cacheFileStream)\r\n   at GleamTech.Caching.FileCache._as(IDisposable context, FileSystem fileSystem, _WF cacheFileInfo, Action`1 createAction)\r\n   at GleamTech.Caching.FileCache.GetOrAdd(FileCacheKey cacheKey, Action`1 createAction)\r\n   at GleamTech.DocumentUltimate.Caching.DocumentCache.GetOrAddPdf(DocumentCacheInfo cacheInfo, String attachment)\r\n   at GleamTech.DocumentUltimate.Caching.DocumentCache._b8e._Are(Stream cacheFileStream)\r\n   at GleamTech.Caching.FileCache._as(IDisposable context, FileSystem fileSystem, _WF cacheFileInfo, Action`1 createAction)\r\n   at GleamTech.Caching.FileCache.GetOrAdd(FileCacheKey cacheKey, Action`1 createAction)\r\n   at GleamTech.DocumentUltimate.Caching.DocumentCache.GetOrAddXpz(DocumentCacheInfo cacheInfo, String attachment)\r\n   at GleamTech.DocumentUltimate.AspNet.UI.DocumentViewerHandler.PrepareDocument(String cacheInfoKey, String attachment)",
    "InnerException": {
      "Type": "System.DllNotFoundException",
      "Message": "Unable to load DLL 'PortableEngine.Native.dll' or one of its dependencies: A dynamic link library (DLL) initialization routine failed. (0x8007045A)",
      "StackTrace": "   at _dZb.PEN_PDFNtvInitialize(String lic_key)\r\n   at _d3b.Initialize()\r\n   at _bZE._bGf()\r\n   at _bZE..cctor()"
    }
  }
}
I run that .NET Core 6 Application in Azure, already update it to a billed AppService, as you wrote in https://support.gleamtech.com/community/a6640/unable-to-load-dll-portableengine_native_dll-one-its-dependencies-specified-module.aspx

Also i checked the permission for the D:\Home -> the GleamTech Folder is created:

I also tried to copy these DLL into the wwwroot folder, but didn't changed.

DocumentUltimate Version 6.5.0 is in use.

I would be very grateful for some assistance with this problem.
Best regards
Patrick
0
Cem Alacayir Replied
Employee Post Marked As Resolution
Hi Patrick,
Your error "A dynamic link library (DLL) initialization routine failed. (0x8007045A)" is different and users reported " this is somehow related to running the app with a Azure free shared plan -- upgrading the plan to a paid tier made the issue go away."

Please try to restart your App Service and see if it is solved.
1
Patrick Riehmers Replied
Hi Cem,

thanks alot for your reply! Now it works as expected!
For all, who have the same Problem:
D1 under Dev/Test Plans doesn't work (even is it a paid plan), you need to have dedicated Compute-units (ACU).

Best regards
Patrick

Reply to Thread