-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.DllNotFoundException - Unable to load DLL 'wkhtmltox.dll': Access is denied #184
Comments
Also does it matter that Identity of application pool? I used application pool identity that set both of them. |
Did you ever figure this out @mertmtn? I am having the same issue |
@tofer When I tried to change application pool identity on IIS, it works. I do not remember that what I selected identity. It can be related to your server. You must try to change identity |
Thanks @mertmtn for the reply. I actually found the reason for the issue (as I was having it), which is this line in the TempFolderDeployment class. It uses the application's base directory name I re-wrote the [Serializable]
public class IISTempFolderDeployment : IDeployment
{
public string Path { get; }
public CustomTempFolderDeployment()
{
// Build a folder name to use in the system's temp directory based on the IIS site name (sanitized)
var appFolder = System.IO.Path.GetInvalidFileNameChars()
.Aggregate($"wkhtmltox-{System.Web.Hosting.HostingEnvironment.ApplicationHost.GetSiteName()}",
(current, c) => current.Replace(c, '-'));
Path = System.IO.Path.Combine(System.IO.Path.GetTempPath(), appFolder);
}
} with usage Converter = new ThreadSafeConverter(new RemotingToolset<PdfToolset>(new WinAnyCPUEmbeddedDeployment(new IISTempFolderDeployment()))); Now instead prod/dev using |
@tofer Is IISTempFolderDeployment class your custom one? Which layer uses the class on your project. Maybe I used on my project, if i need. It stay as another solution. |
@mertmtn yes the |
I am faced with the problem convert html to pdf using TuesPechkin. I have two applications on IIS and both of the apps have different application pool.
But I got an error from one of these:
Unable to load DLL 'wkhtmltox.dll': Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) Stack trace Server stack trace: at TuesPechkin.WkhtmltoxBindings.wkhtmltopdf_init(Int32 useGraphics) at TuesPechkin.PdfToolset.Load(IDeployment deployment) at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg) Exception rethrown at [0]: at TuesPechkin.ThreadSafeConverter.Invoke[TResult](FuncShim1 delegate)
at Codaxy.WkHtmlToPdf.PdfConvert.ConvertHtmlToPdf(List1 documentlist) at ArastirmaYonetim.Controllers.RaporController.HtmlRaporOnizle(ArastirmaRaporAramaKriter raporAramaKriter)
But other app works correctly.
I checked that wkhtmltopdf file of both applications have right permission which is full control.
System web part of web config and I use .net framework 4.7.2
<system.web> </system.web>
The text was updated successfully, but these errors were encountered: