title: Generate an image from an HTML code/file in .NET Core 2.x Console Application?
body: <p>I've currently a problem with the <a href="https://www.nrecosite.com/html_to_image_generator_net.aspx" rel="nofollow noreferrer">NReco.ImageGenerator</a> in a .NET Core 2.x console application that I can't get an image because of course, the console application is not web service at all.</p>
  
  <p><strong>My question now is:</strong> Is there a way to use a somehow web service in a console application so I can generate an image from an HTML code/file or is there any other solution to generate an image from HTML code/file in a .NET Core 2.x console application?</p>
  
  <h2>Edit</h2>
  
  <p>It works on .NET Standard but not on .NET Core.
   </p>
  
  <pre class="lang-cs prettyprint-override"><code>var html = string.Format("&lt;h1&gt;Hello World!&lt;/h1&gt;");
  var converter = new HtmlToImageConverter // Exception happens here
          {
              Width = 250,
              Height = 70
          };
  var bytes = converter.GenerateImage(html, NReco.ImageGenerator.ImageFormat.Png); 
  </code></pre>
  
  <p>Exception: 
  </p>
  
  <pre class="lang-cs prettyprint-override"><code>System.TypeLoadException: Could not load type 'System.Web.HttpContext' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
  at NReco.ImageGenerator.HtmlToImageConverter..ctor()
  at SESL.Modules.SESL.User.UserImage() in E:\Source\SESL-Discord\SESL\Modules\SESL\User.cs:line 36
  </code></pre>