title: Trying to call third party dll from Azure Function V2 I get an exception
body: <p>I strictly follow this sample: <a href="https://odetocode.com/blogs/scott/archive/2018/02/14/pdf-generation-in-azure-functions-v2.aspx" rel="nofollow noreferrer">https://odetocode.com/blogs/scott/archive/2018/02/14/pdf-generation-in-azure-functions-v2.aspx</a></p>
  
  <p>I download the three files from the DinkToPdf <a href="https://github.com/rdvojmoc/DinkToPdf/tree/master/v0.12.4" rel="nofollow noreferrer">repository</a></p>
  
  <p>Problem is when I add either 32bit OR 64bit DLLs, I get the following error:</p>
  
  <blockquote>
    <p>One or more errors occurred. (An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B))</p>
  </blockquote>
  
  <p>on this code in particular:</p>
  
  <pre><code>private static byte[] BuildPdf(string html)
      {
          byte[] arr = null;
  
          try
          {
              arr = pdfConverter.Convert(new HtmlToPdfDocument() { Objects = { new ObjectSettings { HtmlContent = html } } });
          }
          catch (Exception ex)
          {
              System.Diagnostics.Debug.WriteLine(ex);
          }
  
          return arr;
      }
  </code></pre>
  
  <p>My Azure Function V2 .net Core project is set to Any CPU with no option for other. I saw other posts on Stack Overflow about this error and I feel that this is different because other people are talking about two projects that have control over and there is some differences in the architecture, but here I just point a few binaries and no matter if they are 32 or 64 the error stays. Also I saw that some people change settings of the IIS and I don't have such. Any ideas? Thanks!</p>
  
  <p><a href="https://i.stack.imgur.com/kEx4I.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kEx4I.jpg" alt="enter image description here"></a></p>