title: SignalR Error 500 on server - asp.net
body: <p>I have a simple chat application that works fine locally, but the SignalR throws an internal server error remotely. </p>
  
  <p>The script that throws the error looks like this:</p>
  
  <blockquote>
    <p><a href="http://mydomainname.com/signalr/negotiate?clientProtocol=1.5&amp;connectionData" rel="nofollow noreferrer">http://mydomainname.com/signalr/negotiate?clientProtocol=1.5&amp;connectionData</a>...</p>
  </blockquote>
  
  <p>Here is the log:
  <a href="https://i.stack.imgur.com/wonl8.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wonl8.jpg" alt="enter image description here"></a></p>
  
  <p>I have looked at other answers on a similar topic but none seem to work for me.
  These are the answers I referenced: <a href="https://stackoverflow.com/questions/19910943/signalr-negotiate-404">SignalR Negotiate 404</a>, <a href="https://stackoverflow.com/questions/26879633/signalr-negotiate-404-on-subdomain">SignalR Negotiate 404 on Subdomain</a>.</p>
  
  <p>Here is the client code:</p>
  
  <pre><code>$(function () {
                  // Reference the auto-generated proxy for the hub.
                  $.connection.hub.url = 'http://mydomainname.com/signalr';
                  $.connection.hub.logging = true;
  
                  var chat = $.connection.chatHub;
  
                  var name = '&lt;%= username%&gt;'
                  // Create a function that the hub can call back to display messages.
                  chat.client.addNewMessageToPage = function (name, message) {
                      // Add the message to the page.
                      bootbox.alert({
                          message: "&lt;b&gt;" + name + "&lt;/b&gt;: " + message,
                      });
                  };
  
                  chat.client.sendMessage = function (name, message) {
                      // Add the message to the page.
                      $('#discussion').append('&lt;li&gt;&lt;strong&gt;' + htmlEncode(name)
                         + '&lt;/strong&gt;: ' + $('#message').val() + '&lt;/li&gt;');
                  };
                  // Start the connection.
                  $.connection.hub.start().done(function () {
                     // code to append message omitted.
                  });
  });
  </code></pre>
  
  <p>On navigating to the error link I get a Cryptographic Exception as shown here: <a href="https://stackoverflow.com/questions/15393684/signalr-cryptographicexception-on-azurewebsites">SignalR CryptographicException on AzureWebsites</a>. Is there a solution to this problem?</p>
  
  <p>I'm using asp.net 4.5 and SignalR 2. I have tried lots of things and I'm not sure why the internal server error exists. Any help will be greatly appreciated.</p>