Note that there are some explanatory texts on larger screens.

plurals
  1. POSignalR: Internal Server Error when calling hub method
    primarykey
    data
    text
    <p>I've been playing around with SignalR for a few days and I have to say that it's an absolutely phenomenal library. I've managed to get a few things working with it and was astounded at the simplicity, but I recently ran into a small problem.</p> <p>I'm unable to call a Hub method from JavaScript in the browser. The request returns a 500 error code, and when I look at the error page source, I see this:</p> <pre><code>[ArgumentNullException: Value cannot be null. Parameter name: s] System.IO.StringReader..ctor(String s) +10207225 Newtonsoft.Json.Linq.JObject.Parse(String json) +74 SignalR.Hubs.HubRequestParser.Parse(String data) +78 SignalR.Hubs.HubDispatcher.OnReceivedAsync(IRequest request, String connectionId, String data) +266 SignalR.&lt;&gt;c__DisplayClass6.&lt;ProcessRequestAsync&gt;b__4(String data) +84 SignalR.Transports.ForeverTransport.ProcessSendRequest() +159 SignalR.Transports.ForeverTransport.ProcessRequestCore(ITransportConnection connection) +149 SignalR.Transports.ForeverTransport.ProcessRequest(ITransportConnection connection) +42 SignalR.PersistentConnection.ProcessRequestAsync(HostContext context) +1087 SignalR.Hubs.HubDispatcher.ProcessRequestAsync(HostContext context) +251 SignalR.Hosting.AspNet.AspNetHandler.ProcessRequestAsync(HttpContextBase context) +656 SignalR.Hosting.AspNet.HttpTaskAsyncHandler.System.Web.IHttpAsyncHandler.BeginProcessReques t(HttpContext context, AsyncCallback cb, Object extraData) +143 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9479007 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +178 </code></pre> <p>My server-side code is:</p> <pre><code>public class SourceHub : Hub { public void RegisterSource(string source) { Groups.Add(Context.ConnectionId, source); } } </code></pre> <p>and on the client-side I have:</p> <pre><code>var SourceHub = $.connection.sourceHub; $.connection.hub.start().done(function () { SourceHub.registerSource("test"); }); </code></pre> <p>I've been digging for a while, but I just can't find the source of the problem... could someone please help me out?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload