You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
There is a bug with MsgPack support.
There is no data conversion in the Update_VM method in the DotNetifyLib.SignalR\DotNetifyHub.cs.
My solution:
private object ConvertData(object data)
{
if (data == null)
return null;
else if (data is JsonElement)
// System.Text.Json protocol.
return JObject.Parse(((JsonElement)data).GetRawText());
else if (data is JObject)
// Newtonsoft.Json protocol.
return data as JObject;
else if (data.GetType().IsPrimitive || data is string)
return data;
else
// MessagePack protocol.
return JObject.FromObject(data);
}
public void Request_VM(string vmId, object vmArg)
{
var data = ConvertData(vmArg);
......
public void Update_VM(string vmId, Dictionary<string, object> vmData)
{
try
{
_callerContext = Context;
if (vmData != null)
{
var keys = vmData.Keys.ToArray();
foreach (var key in keys)
{
vmData[key] = ConvertData(vmData[key]);
}
}
.......
The text was updated successfully, but these errors were encountered:
Hi,
There is a bug with MsgPack support.
There is no data conversion in the Update_VM method in the DotNetifyLib.SignalR\DotNetifyHub.cs.
My solution:
The text was updated successfully, but these errors were encountered: