title: Service Reference Error when trying to update or remove/add
body: <p>I have been searching for an answer to my service reference error for days now with no change. I made some changes to this web app a few months ago and I was able to update the service reference without any issue. Now, I made pretty much identical changes recently, but cannot update the service reference in the solution without an error:
  There was an error </p>
  
  <pre><code>downloading 'http://localhost:57903/CreateServiceCall.xamlx/_vti_bin/ListData.svc/$metadata'.
  The request failed with the error message:
  ....
  The remote server returned an error: (500) Internal Server Error.
  If the service is defined in the current solution, try building the solution and adding the service reference again.
  </code></pre>
  
  <p>Or </p>
  
  <pre><code>The service reference is invalid. The .svcmap file ('C:\Projects_2010...') cannot be loaded. It may be corrupted or in a bad format: The service reference is invalid, because the .svcmap file.
  </code></pre>
  
  <p>This error seems to refence my localhost port so I check to see if the port is listening with cmd > netstat -anb. It looks like this port is listening as it should with this command. Some of the error messages that I was getting asked me to remove and add the service reference, so I did and I got a error message with a  little more detail but it still did not help find a solution:</p>
  
  <pre><code> Metadata contains a reference that cannot be resolved: 'http://localhost:57903/CreateServiceCall.xamlx'.
  An error occurred while receiving the HTTP response to http://localhost:57903/CreateServiceCall.xamlx. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.
  The underlying connection was closed: An unexpected error occurred on a receive.
  Unable to read data from the transport connection: An established connection was aborted by the software in your host machine.
  An established connection was aborted by the software in your host machine
  If the service is defined in the current solution, try building the solution and adding the service reference again.
  </code></pre>
  
  <p>No changes have been made to this web application since the last time it was update, so I am confused as to why this service reference would be invalid all of a sudden. Here is my web.config server and binding info:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
          &lt;bindings&gt;
     &lt;basicHttpBinding&gt;
      &lt;binding name="BasicHttpBinding_IApplicationService" closeTimeout="00:01:00"
       openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
       allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
       maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
       textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"
       messageEncoding="Text"&gt;
       &lt;readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647"
        maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /&gt;
       &lt;security mode="None"&gt;
        &lt;transport clientCredentialType="None" proxyCredentialType="None"
         realm="" /&gt;
        &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt;
       &lt;/security&gt;
      &lt;/binding&gt;
      &lt;binding name="BasicHttpBinding_IService" /&gt;
     &lt;/basicHttpBinding&gt;
    &lt;/bindings&gt;
          &lt;client&gt;
        &lt;endpoint address="http://"actual_url"/CreateServiceCall.xamlx"
      binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IApplicationService"
      contract="Application.IApplicationService" name="BasicHttpBinding_IApplicationService" /&gt;
        &lt;endpoint address="http://"actual_url"/CreateServiceCall.xamlx"
         binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"
         contract="CreateServiceCall.IService" name="BasicHttpBinding_IService" /&gt;
        &lt;!--&lt;endpoint address="http://localhost:57903/CreateServiceCall.xamlx" 
     binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IApplicationService"
     contract="Application.IApplicationService" name="BasicHttpBinding_IApplicationService"  /&gt;
        &lt;endpoint address="http://localhost:57903/CreateServiceCall.xamlx"
         binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"
         contract="CreateServiceCall.IService" name="BasicHttpBinding_IService" /&gt;--&gt;
    &lt;/client&gt;
          &lt;behaviors&gt;
              &lt;serviceBehaviors&gt;
                  &lt;behavior&gt;
                      &lt;serviceMetadata httpGetEnabled="true"/&gt;
                      &lt;!--&lt;sqlWorkflowInstanceStore connectionStringName="WF4Persistence" /&gt;--&gt;
                      &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt;
                  &lt;/behavior&gt;
              &lt;/serviceBehaviors&gt;
          &lt;/behaviors&gt;
          &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
      &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>The web app is set to use the same dev server as is in the web.config.
  I am very lost right now as to why this error keeps happing. I even rolled back many months to a previous version in TFS and tried opening the project on my other virtual machine, but the error still persists. I would appreciate any help. 
  Thanks,</p>