title: An established connection was aborted by the software in your host machine (VS dev server)
body: <p>I've seen similar posts about this problem, but none of them relate to the use of the Visual Studio development server for ASP .NET.</p>
  
  <p>I'm receiving the following error.</p>
  
  <p><strong>An established connection was aborted by the software in your host machine</strong>.</p>
  
  <p>And I'm executing the following code:</p>
  
  <pre><code>String employeesJson = client.downloadString("http://localhost:60000/Api/Employee/GetEmployees.aspx");
  </code></pre>
  
  <p>When I run this in a regular webbrowser (Chrome 21 or Internet Explorer 10) it runs just fine. I get the JSON result that I want.</p>
  
  <p>And my <code>WebClient</code> class being used (under the variable "<code>client</code>") is defined as follows.</p>
  
  <pre><code>public class WebClient {
  
      private HttpClient httpClient;
  
      public WebClient() {
  
          httpClient = new DefaultHttpClient();
  
      }
  
      public String downloadString(String url) throws IOException {
  
          HttpGet get = new HttpGet(url);
  
          try {
  
              HttpResponse response = httpClient.execute(get); //this is where the error occurs.
              HttpEntity entity = response.getEntity();
              if(entity != null) {
  
                  InputStream stream = entity.getContent();
                  InputStreamReader streamReader = new InputStreamReader(stream);
  
                  BufferedReader bufferedReader = new BufferedReader(streamReader);
                  StringBuilder builder = new StringBuilder();
  
                  String line = null;
                  try {
                      while ((line = bufferedReader.readLine()) != null) {
                          builder.append(line + "\n");
                      }
                  } catch (IOException e) {
                      e.printStackTrace();
                  } finally {
                      try {
                          stream.close();
                      } catch (IOException e) {
                          e.printStackTrace();
                      }
                  }
  
                  return builder.toString();
  
              }
  
          //catch all the types of exceptions this method can throw. catching "Exception" is considered bad.
          } catch (ClientProtocolException e) {
              e.printStackTrace();
          }
  
          return null;
  
      }
  
  }
  </code></pre>
  
  <p>My AndroidManifest.xml file looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="specialisering.android"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk android:minSdkVersion="15" /&gt;
      &lt;uses-permission android:name="android.permission.INTERNET"&gt;&lt;/uses-permission&gt;
      &lt;application
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name" &gt;
          &lt;activity
              android:name=".MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>