diff --git a/src/extensions/BootstrapBlazor.Socket/BootstrapBlazor.Socket.csproj b/src/extensions/BootstrapBlazor.Socket/BootstrapBlazor.Socket.csproj index 4f0ed118..0cee55f8 100644 --- a/src/extensions/BootstrapBlazor.Socket/BootstrapBlazor.Socket.csproj +++ b/src/extensions/BootstrapBlazor.Socket/BootstrapBlazor.Socket.csproj @@ -1,7 +1,7 @@  - 9.0.11 + 9.0.14 diff --git a/src/extensions/BootstrapBlazor.Socket/DataConverter/DataConverter.cs b/src/extensions/BootstrapBlazor.Socket/DataConverter/DataConverter.cs index 730bb469..672efdfc 100644 --- a/src/extensions/BootstrapBlazor.Socket/DataConverter/DataConverter.cs +++ b/src/extensions/BootstrapBlazor.Socket/DataConverter/DataConverter.cs @@ -3,6 +3,7 @@ // Website: https://www.blazor.zone or https://argozhang.github.io/ using BootstrapBlazor.Socket.Logging; +using System.Diagnostics; using System.Reflection; namespace BootstrapBlazor.Socket.DataConverters; @@ -65,6 +66,10 @@ protected virtual bool Parse(ReadOnlyMemory data, TEntity entity) { // 通过 SocketDataPropertyConverterAttribute 特性获取属性转换器 var properties = entity.GetType().GetProperties().Where(p => p.CanWrite).ToList(); + if (Debugger.IsAttached) + { + SocketLogging.LogDebug($"Data: {BitConverter.ToString(data.ToArray())}"); + } foreach (var p in properties) { var attr = p.GetCustomAttribute(false) ?? GetPropertyConverterAttribute(p); @@ -78,7 +83,7 @@ protected virtual bool Parse(ReadOnlyMemory data, TEntity entity) } else { - SocketLogging.LogInformation($"{nameof(Parse)} failed. Can't convert value from {GetValueType(valueType)} to {p.PropertyType}"); + SocketLogging.LogInformation($"{nameof(Parse)} failed. Start: {attr.Offset}. Length: {attr.Length}. Can't convert value from {GetValueType(valueType)} to {p.Name}({p.PropertyType})"); } } }