title: Unable to load the dll libwkhtmltox using dinktopdf for a .net core2.2 azure functionapp
body: <p>I have an Azure functionapp using .net Core 2.2 that is written for the converting the html text to pdf. I am using the DinkToPdf. When I run the function, I get "Unable to load the libwkhtmltox.dll. I have tried the alternate solutions as mentioned in some of the posts, but it still throws the same error. </p>
  
  <p>I tried using Directory.GetCurrentDirectory and using path.combine</p>
  
  <p>The code is below:</p>
  
  <pre><code>        [FunctionName("Function1")]
          public static async Task&lt;IActionResult&gt; Run(
              [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
              ILogger log)
          {
              log.LogInformation("C# HTTP trigger function processed a request.");
  
              CustomAssemblyLoadContext context = new CustomAssemblyLoadContext();
              var architectureFolder = (IntPtr.Size == 8) ? "64 bit" : "32 bit";
              context.LoadUnmanagedLibrary($@"{Directory.GetCurrentDirectory()}\Dependencies\libwkhtmltox.dll");
  
              var IocContainer = new SynchronizedConverter(new PdfTools());
              string html = await new StreamReader(req.Body).ReadToEndAsync();
              var globalSettings = new GlobalSettings
              {
                  ColorMode = ColorMode.Color,
                  Orientation = Orientation.Portrait,
                  PaperSize = PaperKind.A4,
                  Margins = new MarginSettings { Top = 10 },
              };
              var objectSettings = new ObjectSettings
              {
                  PagesCount = true,
                  WebSettings = { DefaultEncoding = "utf-8" },
                  HtmlContent = html
              };
  
              var pdf = new HtmlToPdfDocument()
              {
                  GlobalSettings = globalSettings,
                  Objects = { objectSettings }
              };
  
              byte[] pdfBytes = null;// IocContainer.Convert(pdf);
              return new FileContentResult(pdfBytes, "application/pdf");
          }
  }
  </code></pre>