You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I answered someone else's problem, mine was still only partially solved.
I'm using the library on a website that allows multiple users to upload PDF's at the same time and needs to invoke the GS DLL simultaneously. What I found was this is not possible so instead I use this solution
This has been working fine for 99.5% of cases but now for the first time after several months on the server I see this rare-bird 4 times in an hour for a user that I cannot replicate:
System.Exception: Module could not be loaded.
at Microsoft.WinAny.Interop.DynamicNativeLibrary..ctor(String fileName)
at Ghostscript.NET.GhostscriptLibrary..ctor(GhostscriptVersionInfo version, Boolean fromMemory)
at Ghostscript.NET.Interpreter.GhostscriptInterpreter..ctor(GhostscriptVersionInfo version, Boolean fromMemory)
at Ghostscript.NET.Viewer.GhostscriptViewer.Open(String path, GhostscriptVersionInfo versionInfo, Boolean dllFromMemory)
at Ghostscript.NET.Viewer.GhostscriptViewer.Open(Stream stream, GhostscriptVersionInfo versionInfo, Boolean dllFromMemory)
at Ghostscript.NET.Rasterizer.GhostscriptRasterizer.Open(Stream stream, GhostscriptVersionInfo versionInfo, Boolean dllFromMemory)
I have no idea how to replicate it and she tried later with the exact same .pdf upload and this time it works again fine.
My guess is something about the DLL not being entirely in memory correctly, or else IIS recycling and losing the static lock -- but this should be a very rare thing in production and I'm wondering if something else weird is going on with the DLL.
I believe the fix I found involves enabling 32-bit applications to run in your IIS application pool. (Or at least this is a necessary if not sufficient part of the answer.) Then recycle your pool/app. Elsewise it takes a lot of fiddling still maybe... :(
Definitely look at trying both raster.Open(fileStream, _version, false) and raster.Open(fileStream, _version, true) and comparing performance. Often when one of these doesn't work the other does. If you open from file, lock with static lock around the region you need it open for multiple users.
For such a popular library, it does have some weird little ghosts, if you'll pardon the pun.
We're getting the same errors randomly on some of our web servers. We've been using GhostScript.NET for years without any problems. We've tried enabling 32-bit applications, it seemed to work for a while but the problems came back. So, recycling the app pool seems to fix the problem temporarily, but that's not a long term solution.
So, short of periodically recycling the app pool, any clues/ideas?
Activity
ahmetmert commentedon Apr 12, 2018
Did you somehow fix this issue ? After it is been used for a few month, I start constantly getting this exception
JohnVLinton commentedon Apr 12, 2018
I believe the fix I found involves enabling 32-bit applications to run in your IIS application pool. (Or at least this is a necessary if not sufficient part of the answer.) Then recycle your pool/app. Elsewise it takes a lot of fiddling still maybe... :(
Definitely look at trying both raster.Open(fileStream, _version, false) and raster.Open(fileStream, _version, true) and comparing performance. Often when one of these doesn't work the other does. If you open from file, lock with static lock around the region you need it open for multiple users.
For such a popular library, it does have some weird little ghosts, if you'll pardon the pun.
Krashlog commentedon Mar 13, 2019
We're getting the same errors randomly on some of our web servers. We've been using GhostScript.NET for years without any problems. We've tried enabling 32-bit applications, it seemed to work for a while but the problems came back. So, recycling the app pool seems to fix the problem temporarily, but that's not a long term solution.
So, short of periodically recycling the app pool, any clues/ideas?
jhabjan commentedon Feb 4, 2021
Fixed in today's v.1.2.2. release.