We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在 v0.1.122 版本后,当调用 MessageJsonSerializer.DeserializeAsync() 方法的时候会抛出下面的异常: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot implicitly convert type 'System.Threading.Tasks.Task<Newtonsoft.Json.Linq.JObject>' to 'System.Threading.Tasks.Task<object>' at CallSite.Target(Closure , CallSite , Object ) at Apworks.ObjectSerializer.DeserializeAsync(Byte[] data, CancellationToken cancellationToken) at Apworks.Serialization.Json.MessageJsonSerializer.<DeserializeAsync>d__4.MoveNext()
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot implicitly convert type 'System.Threading.Tasks.Task<Newtonsoft.Json.Linq.JObject>' to 'System.Threading.Tasks.Task<object>' at CallSite.Target(Closure , CallSite , Object ) at Apworks.ObjectSerializer.DeserializeAsync(Byte[] data, CancellationToken cancellationToken) at Apworks.Serialization.Json.MessageJsonSerializer.<DeserializeAsync>d__4.MoveNext()
查看源码后应该是下面的代码引起的: public virtual Task<dynamic> DeserializeAsync(byte[] data, CancellationToken cancellationToken = default(CancellationToken)) => Task.FromResult(Deserialize(data)); 估计是 Task.FromResult() 不能处理 dynamic 类型引起的。
public virtual Task<dynamic> DeserializeAsync(byte[] data, CancellationToken cancellationToken = default(CancellationToken)) => Task.FromResult(Deserialize(data));
The text was updated successfully, but these errors were encountered:
是的,这个问题在之前的版本存在,原因是Deserialize返回的dynamic类型其实是JObject类型,它无法被反序列化成一个具体的对象模型。现在应该已经修复了。
Sorry, something went wrong.
No branches or pull requests
在 v0.1.122 版本后,当调用 MessageJsonSerializer.DeserializeAsync() 方法的时候会抛出下面的异常:
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot implicitly convert type 'System.Threading.Tasks.Task<Newtonsoft.Json.Linq.JObject>' to 'System.Threading.Tasks.Task<object>' at CallSite.Target(Closure , CallSite , Object ) at Apworks.ObjectSerializer.DeserializeAsync(Byte[] data, CancellationToken cancellationToken) at Apworks.Serialization.Json.MessageJsonSerializer.<DeserializeAsync>d__4.MoveNext()
查看源码后应该是下面的代码引起的:
public virtual Task<dynamic> DeserializeAsync(byte[] data, CancellationToken cancellationToken = default(CancellationToken)) => Task.FromResult(Deserialize(data));
估计是 Task.FromResult() 不能处理 dynamic 类型引起的。
The text was updated successfully, but these errors were encountered: