title: FSharp.Data missing method exception
body: <p>I am trying to resolve a <em>MissingMethodException</em> in a pre-compiled F# Azure Function. The exception is thrown when I call an extension method from <em>FSharp.Data.CssSelectorExtensions</em>. </p>
  
  <p>The function is defined in a .Net Framework 4.6.2 class library. I am using the current versions of <em>FSharp.Core</em> (4.2.3) and <em>FSharp.Data</em> (2.3.3). (I have tried older versions of both but the problem persists.) I have added a binding redirect for <em>FSharp.Core</em> per the standard guidance for this kind of problem. The code compiles cleanly but fails when it is executed. It also fails if I attempt to invoke the extension method directly as a simple static method. </p>
  
  <p>Any guidance on how I can get rid of this exception would be much appreciated!</p>
  
  <p><strong>Function Code</strong></p>
  
  <pre><code>module httpfunc
  
  open System.Net
  open System.Net.Http
  open Microsoft.Azure.WebJobs.Host
  open FSharp.Data
  open FSharp.Data.CssSelectorExtensions
  
  let Run(req: HttpRequestMessage, log: TraceWriter) =
      async {
          let doc = HtmlDocument.Load("https://google.com")
          let node = doc.CssSelect("div.ctr-p") // &lt;-- method is missing
          return req.CreateResponse(HttpStatusCode.OK)
      } |&gt; Async.RunSynchronously
  </code></pre>
  
  <p><strong>Exception Message</strong></p>
  
  <pre><code> mscorlib: Exception while executing function: Functions.httpfunc. 
   mscorlib: Exception has been thrown by the target of an invocation. 
   fsfuncs: Method not found: 'Microsoft.FSharp.Collections.FSharpList`1&lt;FSharp.Data.HtmlNode&gt; CssSelectorExtensions.CssSelect(FSharp.Data.HtmlDocument, System.String)'.
  </code></pre>
  
  <p><strong><em>app.config</em></strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;startup&gt;
      &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" /&gt;
    &lt;/startup&gt;
    &lt;runtime&gt;
      &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-4.4.1.0" newVersion="4.4.1.0" /&gt;
        &lt;/dependentAssembly&gt;
      &lt;/assemblyBinding&gt;
    &lt;/runtime&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p><strong><em>packages.config</em></strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;packages&gt;
    &lt;package id="FSharp.Core" version="4.2.3" targetFramework="net462" /&gt;
    &lt;package id="FSharp.Data" version="2.3.3" targetFramework="net462" /&gt;
    ...
  &lt;/packages&gt;
  </code></pre>
  
  <p><strong><em>.fsproj</em></strong></p>
  
  <pre><code>&lt;Project ToolsVersion="15.0" ... /&gt;
    &lt;PropertyGroup&gt;
      &lt;RootNamespace&gt;fsfuncs&lt;/RootNamespace&gt;
      &lt;AssemblyName&gt;fsfuncs&lt;/AssemblyName&gt;
      &lt;TargetFrameworkVersion&gt;v4.6.2&lt;/TargetFrameworkVersion&gt;
      &lt;TargetFSharpCoreVersion&gt;4.4.1.0&lt;/TargetFSharpCoreVersion&gt;
      &lt;AutoGenerateBindingRedirects&gt;true&lt;/AutoGenerateBindingRedirects&gt;
      &lt;Name&gt;fsfuncs&lt;/Name&gt;
    &lt;/PropertyGroup&gt;
    ...
  &lt;/Project&gt;
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p>On Fyodor Soikin's advice I've determined that multiple versions of FSharp.Core.dll are being loaded: one from the GAC and one from the NuGet packages folder.</p>
  
  <p><a href="https://i.stack.imgur.com/2wNlV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2wNlV.png" alt="Two versions of FSharp.Core.dll are loaded."></a></p>