add service reference visual studio 2019 Request format is unrecognized for URL unexpectedly ending in '/$metadata'. code example
Example: Request format is unrecognized for URL unexpectedly ending in '/grid'
<configuration>
<system.web>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
</system.web>
</configuration>