WkHtmlToXSharp icon indicating copy to clipboard operation
WkHtmlToXSharp copied to clipboard

Could not load file or assembly `System.Configuration.ConfigurationManager`

Open amura11 opened this issue 3 years ago • 0 comments

Steps to Reproduce

  1. Install the WkHtmlToXSharp.Bundle Nuget package
  2. Try to run the following code:
WkHtmlToXLibrariesManager.Register(new Linux32NativeBundle());
WkHtmlToXLibrariesManager.Register(new Linux64NativeBundle());
WkHtmlToXLibrariesManager.Register(new Win32NativeBundle());
WkHtmlToXLibrariesManager.Register(new Win64NativeBundle());

using (MultiplexingConverter converter = new MultiplexingConverter())
{
	//WkHtmlToPdfConverter converter = new WkHtmlToPdfConverter();
	converter.GlobalSettings.Size.PageSize = PdfPageSize.Letter;

	byte[] data = converter.Convert(@"
	<!DOCTYPE html>
	<html>
	<body>

	<h1>My First Heading</h1>

	<p>My first paragraph.</p>

	</body>
	</html>
	");

	File.WriteAllBytes("test.pdf", data);
}

Obviously the fix is to install System.Configuration.ConfigurationManager but the dependencies of WkHtmlToXSharp should probably include this so it gets installed automatically.

amura11 avatar Jan 12 '22 15:01 amura11