SignalR icon indicating copy to clipboard operation
SignalR copied to clipboard

AspNet Samples fail with type conversion error.

Open AlexAllocated opened this issue 14 years ago • 1 comments

I just cloned the repo fresh and opened it up in Visual Studio 2010. I set the SignalR.Hosting.AspNet.Samples project as the startup project and I ran it. Half the samples linked on the default page worked just fine, and the other half did not. They threw an exception on this line

SignalR.Hosting.AspNet.Samples --> HubDispatcher.cs

State = rawRequest.Value<IDictionary<string, object>>("state");

Cannot cast Newtonsoft.Json.Linq.JObject to Newtonsoft.Json.Linq.JToken.

The data string that went through JObject.Parse() looked like this {"hub":"ShapeShare","action":"CreateShape","data":["rectangle"],"state":{},"id":2}.

Going back in history it looks like it broke starting at revision f9e5159f1292e146b6ed242a2df9edb23c77a013 by David yesterday. "Improve parameter resolution, don't re-parse JTokens. Fixes #245."

Being fresh to the project I don't exactly know what's going on in here but I will attempt to implement a fix and submit it. In the meantime, maybe this will help someone else more knowledgeable.

AlexAllocated avatar Mar 30 '12 05:03 AlexAllocated

Thanks for finding this. I'll look into it.

davidfowl avatar Mar 30 '12 09:03 davidfowl