codaxy / wkhtmltopdf

C# wrapper around excellent wkhtmltopdf console utility.
265 stars 92 forks source link

'ConfigurationManager' missing #23

Open charlotte-murray opened 7 years ago

charlotte-murray commented 7 years ago

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.

mstijak commented 7 years ago

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

elsauto commented 7 years ago

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.