wkhtmltopdf icon indicating copy to clipboard operation
wkhtmltopdf copied to clipboard

'ConfigurationManager' missing

Open charlotte-murray opened this issue 8 years ago • 2 comments

I've just updated to the latest version and am seeing an error on line 75 of PDFConvert.cs:

 private static string GetWkhtmlToPdfExeLocation()
 {
    string filePath, customPath = ConfigurationManager.AppSettings["wkhtmltopdf:path"];
    ...

The error is: The name 'ConfigurationManager' does not exist in the current context

How can I fix this? I'm downgrading temporarily as this is urgent but will upgrade again once you have a fix.

charlotte-murray avatar May 09 '17 16:05 charlotte-murray

Have you tried adding System.Configuration reference to your project? I'll check if it can be automatically added during NuGet install.

mstijak avatar May 09 '17 17:05 mstijak

I tried the code just today, I got the same error. Yes, System.Configuration is there. I will try fix it and upload a bug fix.

In the meantime, you can hardcode the location for your .exe file. In my case, that would be... string filePath, customPath = @"C:\Users\Sebastian\Documents\visual studio 2015\Projects\ConsoleApplication\ConsoleApplication\wkhtml";

Thank you all.

elsauto avatar Aug 15 '17 19:08 elsauto