title: System.Net.Http.HttpMethod cannot be serialized, WCF Web API
body: <p>I am using the <a href="http://nuget.org/packages/HttpClient" rel="nofollow">HttpClient</a> library to create a WCF Web API.</p>
  
  <p>Snippet from service contract:</p>
  
  <pre><code>   [ServiceContract]
      public interface IMyService
      {      
          [WebGet(UriTemplate = "Foo/{id}/{securityKey}/{filename}")]
          HttpResponseMessage Foo(int id, string securityKey);
      }
  </code></pre>
  
  <p>When I hit the .svc in a browser I am getting this:</p>
  
  <blockquote>
    <p>System.InvalidOperationException: An exception was thrown in a call to
    a WSDL export extension:
    System.ServiceModel.Description.DataContractSerializerOperationBehavior
    contract: <a href="http://tempuri.org/:IMyService" rel="nofollow">http://tempuri.org/:IMyService</a> ---->
    <strong>System.Runtime.Serialization.InvalidDataContractException: Type
    'System.Net.Http.HttpMethod' cannot be serialized</strong>. Consider marking it
    with the DataContractAttribute attribute, and marking all of its
    members you want serialized with the DataMemberAttribute attribute. 
    If the type is a collection, consider marking it with the
    CollectionDataContractAttribute.  See the Microsoft .NET Framework
    documentation for other supported types.</p>
  </blockquote>
  
  <p>Does this make sense to anyone? The same code worked in a different project, all the libraries are the same in this case, there must be some nuance I am missing.</p>