title: HttpClientException when connecting to working hub from SignalR .NET Client
body: <p>I have a working SignalR application that allows me to connect multiple JavaScript clients and exchange data. When I tried to connect with a .NET client I get the following error:</p>
  
  <pre><code>An exception of type 'Microsoft.AspNet.SignalR.Client.HttpClientException' occurred in mscorlib.dll but was not handled in user code
  
  Additional information: StatusCode: 500, ReasonPhrase: 'Internal Server Error', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
  
  {
    Transfer-Encoding: chunked
    X-SourceFiles: =?UTF-8?B?QzpcVXNlcnNcRGFycmVuXERlc2t0b3BcQ29uc29sZUFwcGxpY2F0aW9uMVxXZWJBcHBsaWNhdGlvbjFcc2lnbmFsclxuZWdvdGlhdGU=?=
    Cache-Control: private
    Date: Thu, 28 May 2015 09:13:06 GMT
    Server: Microsoft-IIS/8.0
    X-AspNet-Version: 4.0.30319
    X-Powered-By: ASP.NET
    Content-Type: text/html; charset=utf-8
  }
  </code></pre>
  
  <p>To remove as many variables as possible I copied the Hub into an brand new web application and copied the .NET client code into a console application. I still get the same exception. Here is my client code:</p>
  
  <pre><code>Dim hubConnection As HubConnection
  Dim chatHubProxy As IHubProxy
  
  Public Async Sub RunTest()
      System.Net.ServicePointManager.DefaultConnectionLimit = 10
  
      hubConnection = New HubConnection("http://localhost:64400")
      hubConnection.Credentials = Net.CredentialCache.DefaultCredentials
      hubConnection.TraceLevel = TraceLevels.All
      hubConnection.TraceWriter = Console.Out
  
      chatHubProxy = hubConnection.CreateHubProxy("Chat")
  
      AddHandler hubConnection.StateChanged, Sub(stateChange) Console.WriteLine("[" &amp; DateTime.Now &amp; "]: " &amp; stateChange.OldState.ToString() &amp; " =&gt;  " &amp; stateChange.NewState.ToString() &amp; " " &amp; hubConnection.ConnectionId)
  
      chatHubProxy.On(Of String, String)("ReceiveMessage", Sub(from, message) Console.WriteLine(message))
      Await hubConnection.Start()
  End Sub
  </code></pre>
  
  <p>Here is the console output:</p>
  
  <pre><code>09:21:54.3952161 - null - ChangeState(Disconnected, Connecting)
  [28/05/2015 10:21:54]: Disconnected =&gt;  Connecting
  [28/05/2015 10:21:56]: Connecting =&gt;  Disconnected
  09:21:56.8448452 - null - Disconnected
  09:21:56.8458461 - null - Transport.Dispose()
  09:21:56.8468465 - null - Closed
  </code></pre>
  
  <p>And here is my hub code:</p>
  
  <pre><code>public class ChatHub : Hub
  {
      public void SendMessage(string name, string message)
      {
          Clients.All.ReceiveMessage(name, message);
      }
  }
  </code></pre>