1

アプリケーションの protobuf-net ライブラリ参照を v2.0.50727 から v4.0.30319 に更新しています。protobuf dll を更新した後、最新バージョンの prtobuf-net の ProtomemberAttribute に OverwriteList (プロジェクトで使用) がないことがわかりました。

protobuf update に影響を与えないように、代わりに OverwriteList で何を使用すればよいか教えてください。

以下は、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; }
    }
}

ありがとう、キラン

4

1 に答える 1

0

それはまだあります。削除も変更もされていません。protobuf-net の正しいバージョンを参照していることを確認してください - 1.0.0.282 を参照していると思われます。以下では、NuGet の現在のビルド (2.0.0.668) を使用しています。

ここに画像の説明を入力

特に、IsPacked(質問のメタデータに) がないことは、使用しているバージョンが本当に古いことを示唆しています。

于 2013-10-23T12:52:26.860 に答える