title: Upgrading projects from .Net 4.6.1 to 4.7.x causes errors in WCF Reference.cs
body: <p>I have a project consuming an ancient ASMX service. While sitting at .Net Framework 4.6.1, I can add a reference to the service and I get no issues. But once I upgrade the project to 4.7 or 4.7.x, I start getting this error(s):</p>
  
  <pre><code>'FlightSchedule': member names cannot be the same as their enclosing type
  </code></pre>
  
  <p>I get this on three types. Apart from the error in code, here are the warnings I get if I try to remove and add the service or update existing:</p>
  
  <pre><code>Custom tool warning: Cannot import wsdl:port
  Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
  XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='DIAFlightScheduleHttpGet']
  XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='DIAFlightSchedule']/wsdl:port[@name='DIAFlightScheduleHttpGet']
  D:\Projects\...\Connected Services\FISAirline\Reference.svcmap  1
  
  Custom tool warning: Cannot import wsdl:port
  Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
  XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='DIAFlightScheduleHttpPost']
  XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='DIAFlightSchedule']/wsdl:port[@name='DIAFlightScheduleHttpPost']
  D:\Projects\...\Connected Services\FISAirline\Reference.svcmap  1
  
  Custom tool warning: Cannot import wsdl:binding
  Detail: The required WSDL extension element 'binding' from namespace 'http://schemas.xmlsoap.org/wsdl/http/' was not handled.
  XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='DIAFlightScheduleHttpGet']
  D:\Projects\...\Connected Services\FISAirline\Reference.svcmap  1
  
  Custom tool warning: Cannot import wsdl:binding
  Detail: The required WSDL extension element 'binding' from namespace 'http://schemas.xmlsoap.org/wsdl/http/' was not handled.
  XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='DIAFlightScheduleHttpPost']
  D:\Projects\...\Connected Services\FISAirline\Reference.svcmap  1
  </code></pre>
  
  <p>I'm not able to figure this one out. If I google the warnings, there are pointers to update the app.config but no protocols are there for me to remove. And I cannot find anything relatable if I search on the error.</p>
  
  <p>I need to update to the latest framework v4.8.</p>
  
  <p>Any help is greatly appreciated.</p>