Exception: Could not load file or assembly 'HtmlRenderer, version=1.5.0.5'
See original GitHub issueHello,
I am trying to convert html from a mail-body into PDF.
I have this code:
using PdfSharp;
using System;
using System.IO;
using TheArtOfDev.HtmlRenderer.PdfSharp;
namespace myNamespace.Services.Pdf
{
public class PdfCreator : IPdfCreator
{
public byte[] CreateFromHtml(string bodyOriginal)
{
if (string.IsNullOrEmpty(bodyOriginal))
return null;
try
{
using (var outputStream = new MemoryStream())
{
var pdf = PdfGenerator.GeneratePdf(bodyOriginal, PageSize.A4);
pdf.Save(outputStream);
var result = outputStream.ToArray();
pdf.Dispose();
return result;
}
}
catch (Exception ex)
{
return null;
}
}
}
}
But always I call this CreateFromHtml function I got an exception:
Could not load file or assembly ‘HtmlRenderer, Version=1.5.0.5, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified.
I am working with net framework 4.6.1 and I have installed HtmlRenderer with Nuget package.
I have tested the htmlrenderer.dll is in the bin folder.
Any help would be appreciated.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Html Generate PDF Display text garbled (chinese)
The first disgusting problem I found is that I was unable to load the winforms dll into the Visual Studio Toolbox to reference...
Read more >Unable to resolve dependencies of NuGet packages
Solution · Clear the NuGet cache files. You do this in the following way: In the toolbar of Visual Studio, navigate to Tools...
Read more >yargs-parser 5.0.0-security.0 npmjs: ...
Government as exportable under License Exception TSU Therefore the following terms apply You agree that you will not export or re export the...
Read more >net Core 2.0 - Package was restored using .NetFramework ...
The package may not be fully compatible. I have a . net core 2.0 console app. I'm trying to read files from TFS...
Read more >https://distro.ibiblio.org/fatdog/packages/720/PAC...
The programs it executes are acpid: configured through a set of configuration files, which can be dropped acpid: into place by packages or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
HtmlRenderer.PdfSharp v1.5.0.6 is loaded as HtmlRenderer.Core v1.5.0.5. Update HtmlRenderer.Core version to v1.5.0.6.
I still get below error. I update to latest version v1.5.0.6:
System.IO.FileNotFoundException: ‘Could not load file or assembly ‘HtmlRenderer, Version=1.5.0.6, Culture=neutral, PublicKeyToken=null’. The system cannot find the file specified.’