Skip to content

.Net client throw ArgumentNullException from JToken.FromObject when Invoke hub method with paramater value null #1655

@Xiaohongt

Description

@Xiaohongt

e.g.

//use the asp.net sample url
var hubConnection = new HubConnection("http://localhost:40476/");
var myHub = hubConnection.CreateHubProxy("shapeShare");
hubConnection.Start().Wait();
myHub.Invoke("changeUserName", "test", null).Wait();

Results:
Unhandled Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: o
at Newtonsoft.Json.Linq.JToken.FromObjectInternal(Object o, JsonSerializer jsonSerializer)
at Newtonsoft.Json.Linq.JToken.FromObject(Object o, JsonSerializer jsonSerializer)
at Microsoft.AspNet.SignalR.Client.Hubs.HubProxy.Invoke[T](String method, Object[] args) in e:\dd\SignalR_Dev_1.1_2\S
ignalR\src\Microsoft.AspNet.SignalR.Client\Hubs\HubProxy.cs:line 89
at Microsoft.AspNet.SignalR.Client.Hubs.HubProxy.Invoke(String method, Object[] args) in e:\dd\SignalR_Dev_1.1_2\Sign
alR\src\Microsoft.AspNet.SignalR.Client\Hubs\HubProxy.cs:line 70

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions