title: Method not found: 'System.Net.Http.Headers.MediaTypeHeaderValue System.Net.Http.Formatting.JsonMediaTypeFormatter.get_DefaultMediaType()'
body: <p>I have a method named <code>GetJSONResponse(...)</code> and here's an extract:</p>
  
  <pre><code>var response = new HttpResponseMessage(httpResponseCode)
              {
                  Content = objectToSerialize != null ?
                      new ObjectContent(objectToSerialize.GetType(), objectToSerialize, new JsonMediaTypeFormatter(), JsonMediaTypeFormatter.DefaultMediaType.MediaType)
                      : null
              };
  </code></pre>
  
  <p>Everything runs fine right up to when this method is called, then I get this error <strong>before the method is entered</strong> (perhaps ASP.NET compiles methods as needed?):</p>
  
  <blockquote>
    <p>Method not found: 'System.Net.Http.Headers.MediaTypeHeaderValue
    System.Net.Http.Formatting.JsonMediaTypeFormatter.get_DefaultMediaType()'.</p>
  </blockquote>
  
  <p>Originally I thought that a name space was missing from the web.config file (for the views), which I tried to add, but it didn't solve anything - then I realized I'm actually calling it via a WebAPI controller 'Get' method (not a view). The DLLs needed exist (copy to local is true), but this still seems to fail. It's quite obvious the error means a method cannot be found, but it compiles and launches fine since the c# file correctly references the type without issues ... any ideas?</p>