Json 反序列化这里需要完整类型名(包含命名空间),所以导致发送出去的数据会变成
命名空间.命名空间下类型名
解决方案:
1.不要放在命名空间下
2.
MsgBase msgBase = (MsgBase)JsonConvert.DeserializeObject(s, Type.GetType(protoName));
改为
Type t = Type.GetType($"命名空间名.{protoName}");
MsgBase msgBase = (MsgBase)JsonConvert.DeserializeObject(s, t);