我们正在将应用程序中的 protobuf-net 库引用从 v2.0.50727 更新到 v4.0.30319。更新 protobuf dll 后,我们发现在最新版本的 prtobuf-net 中,ProtomemberAttribute 中缺少 OverwriteList(在我们的项目中使用)。
有人可以让我知道我们应该在 OverwriteList 中使用什么,这样我们就不会对 protobuf 更新产生任何影响吗?
以下是我从 Protobuf 版本(我们正在更新的)元数据中看到的内容:
#region Assembly protobuf-net.dll, v4.0.30319
// C:\src\MyProjectName\lib\protobuf-net\protobuf-net.dll
#endregion
using System;
namespace ProtoBuf
{
// Summary:
// Declares a member to be used in protocol-buffer serialization, using the
// given Tag. A DataFormat may be used to optimise the serialization format
// (for instance, using zigzag encoding for negative numbers, or fixed-length
// encoding for large values.
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class ProtoMemberAttribute : Attribute
{
// Summary:
// Creates a new ProtoMemberAttribute instance.
//
// Parameters:
// tag:
// Specifies the unique tag used to identify this member within the type.
public ProtoMemberAttribute(int tag);
// Summary:
// Gets or sets the data-format to be used when encoding this value.
public DataFormat DataFormat { get; set; }
//
// Summary:
// Gets or sets a value indicating whether this member is mandatory.
public bool IsRequired { get; set; }
//
// Summary:
// Gets or sets the original name defined in the .proto; not used during serialization.
public string Name { get; set; }
//
// Summary:
// Gets or sets a value indicating whether this member is packed (lists/arrays).
public MemberSerializationOptions Options { get; set; }
//
// Summary:
// Gets the unique tag used to identify this member within the type.
public int Tag { get; }
}
}
谢谢,基兰