Skip to content
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: wkhtmltox0 #22

Closed
dooburt opened this issue Feb 28, 2014 · 4 comments
Closed

System.DllNotFoundException: wkhtmltox0 #22

dooburt opened this issue Feb 28, 2014 · 4 comments

Comments

@dooburt
Copy link

dooburt commented Feb 28, 2014

Firstly, great library and with a the two interfaces (single and multi-thread) this seems to be the programmers choice for html > pdf.

That being said however, I am struggling to get this to work on a development machine. I get on run 'Exception has been thrown by the target of an invocation' ... DllNotFoundException, Unable to Load DLL 'wkhtmltox0'. Your documentation says this is automatically created on first conversion - perhaps this isn't happening? Or I need permissions on the bin or something? Can you offer any suggestions?

Thanks :)

@pruiz
Copy link
Owner

pruiz commented Feb 28, 2014

Hi dooburt,

There has been some temporal API changes to allow decreasing the final
assembly size, and now the native libraries has been split into it's own
nuget packages (WkHtmlToXSharp.Win32, etc.). You need to add a reference to
the native libraries required by your environmnet (mos probably win32 onyl)
and use WkHtmlToXLibrariesManager.Register(..) to register each native
bundle before using WkHtmlToXSharp for the first time.

I am still not 100% convenced by this API, and I open to suggestions..
Maybe scanning all AppDomain's assemblies or bin folder for native bundles
would be a better idea..

Regards
Pablo

On Fri, Feb 28, 2014 at 10:41 AM, dooburt notifications@github.com wrote:

Firstly, great library and with a the two interfaces (single and
multi-thread) this seems to be the programmers choice for html > pdf.

That being said however, I am struggling to get this to work on a
development machine. I get on run 'Exception has been thrown by the target
of an invocation' ... DllNotFoundException, Unable to Load DLL
'wkhtmltox0'. Your documentation says this is automatically created on
first conversion - perhaps this isn't happening? Or I need permissions on
the bin or something? Can you offer any suggestions?

Thanks :)

Reply to this email directly or view it on GitHubhttps://github.com//issues/22
.

@dooburt
Copy link
Author

dooburt commented Feb 28, 2014

Aha! Thank you.
Do you know in what context the file is written? I get System.UnauthorizedAccessException","Message":"Access to the path 'c:\fakepath\invoice-00029.pdf' is denied.". Do you know which user needs permissions for this? IIS_IUSRS?

(btw, fakepath is used for brevity in this example)

@pruiz
Copy link
Owner

pruiz commented Feb 28, 2014

AFAIK if you are running under IIS/Managed ASP.NET, that should be
IIS_IUSR, yes..

On Fri, Feb 28, 2014 at 11:03 AM, dooburt notifications@github.com wrote:

Aha! Thank you.
Do you know in what context the file is written? I get
System.UnauthorizedAccessException","Message":"Access to the path
'c:\fakepath\invoice-00029.pdf' is denied.". Do you know which user needs
permissions for this? IIS_IUSRS?

(btw, fakepath is used for brevity in this example)

Reply to this email directly or view it on GitHubhttps://github.com//issues/22#issuecomment-36336434
.

@dooburt
Copy link
Author

dooburt commented Feb 28, 2014

Perfect. Thanks a lot. This is working now 👍 :)

I saw you were using NServiceBus and Wk via a third-party service, if you have a blog or description of that setup I'd be very keen to read it.

Once again, great work.

@dooburt dooburt closed this as completed Feb 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants