Reputation: 15
I am trying to integrate DinkToPdf dot net core wrapper to an existing dot net core 2.0 web app following the instructions on GitHub. But IConverter/SynchronizedConverter/PdfTools are not getting resolved. Guess I am missing a using statement but cannot determine what..
This is what I have done ..
Used .nuget to install DinkToPdf. The package was successfully installed to users/userprofile/.nuget/.. /dinktopdf folder
downloaded the 64 bit dll's from github (rdvojmoc/DinkToPdf/v0.12.4/64 bit/) to the project folder
updated the startup.cs ConfigureServices() method by adding services.AddSingleton(typeof(IConverter), new SynchronizedConverter(new PdfTools()));
at which point I get the errors with " are you missing a using .. "
I also tried the following, and verified that the path as well as LoadUnmanagedLibrary() are successful.
public void ConfigureServices(IServiceCollection services) { var context = new CustomAssemblyLoadContext(); context.LoadUnmanagedLibrary(Path.Combine(Directory.GetCurrentDirectory(), "libwkhtmltox.dll"));
services.AddSingleton(typeof(IConverter), new SynchronizedConverter(new PdfTools()));
}
What is it that I am missing .. thanks for any assistance.
Upvotes: 1
Views: 1077
Reputation: 15
resolved. Restarting visual studio fixed the issue. May be a caching issue, would like a better reason if possible.
Upvotes: 0